cleanup work

This commit is contained in:
eugenp 2014-09-18 17:33:26 +03:00
parent 71ffd8fb58
commit 7400fdff98
6 changed files with 47 additions and 3 deletions

View File

@ -1,2 +0,0 @@
line 1
a second line

View File

@ -149,7 +149,7 @@ public class JavaInputStreamToXUnitTest {
// tests - InputStream to File
@Test
public final void givenUsingPlainJava_whenConvertingAnInputStreamToAFile_thenCorrect() throws IOException {
public final void givenUsingPlainJava_whenConvertingAnFullInputStreamToAFile_thenCorrect() throws IOException {
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
final byte[] buffer = new byte[initialStream.available()];
initialStream.read(buffer);
@ -162,6 +162,22 @@ public class JavaInputStreamToXUnitTest {
IOUtils.closeQuietly(outStream);
}
@Test
public final void givenUsingPlainJava_whenConvertingAnInProgressInputStreamToAFile_thenCorrect() throws IOException {
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
final File targetFile = new File("src/main/resources/targetFile.tmp");
final OutputStream outStream = new FileOutputStream(targetFile);
final byte[] buffer = new byte[8 * 1024];
int bytesRead;
while ((bytesRead = initialStream.read(buffer)) != -1) {
outStream.write(buffer, 0, bytesRead);
}
IOUtils.closeQuietly(initialStream);
IOUtils.closeQuietly(outStream);
}
@Test
public final void givenUsingGuava_whenConvertingAnInputStreamToAFile_thenCorrect() throws IOException {
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));

View File

@ -2,6 +2,7 @@ package org.baeldung.properties.core;
import org.baeldung.properties.spring.PropertiesWithJavaConfig;
import org.baeldung.properties.spring.PropertiesWithJavaConfigOther;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,6 +14,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { PropertiesWithJavaConfig.class, PropertiesWithJavaConfigOther.class }, loader = AnnotationConfigContextLoader.class)
@Ignore("manual only")
public class ExternalPropertiesWithJavaIntegrationTest {
@Autowired

View File

@ -2,6 +2,7 @@ package org.baeldung.properties.core;
import org.baeldung.properties.spring.PropertiesWithXmlConfigOne;
import org.baeldung.properties.spring.PropertiesWithXmlConfigTwo;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,6 +14,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { PropertiesWithXmlConfigOne.class, PropertiesWithXmlConfigTwo.class }, loader = AnnotationConfigContextLoader.class)
@Ignore("manual only")
public class ExternalPropertiesWithMultipleXmlsIntegrationTest {
@Autowired

View File

@ -1,6 +1,7 @@
package org.baeldung.properties.core;
import org.baeldung.properties.spring.PropertiesWithXmlConfig;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -12,6 +13,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { PropertiesWithXmlConfig.class }, loader = AnnotationConfigContextLoader.class)
@Ignore("manual only")
public class ExternalPropertiesWithXmlIntegrationTest {
@Autowired

View File

@ -0,0 +1,24 @@
package org.baeldung.test;
import org.baeldung.properties.core.ExternalPropertiesWithJavaIntegrationTest;
import org.baeldung.properties.core.ExternalPropertiesWithMultipleXmlsIntegrationTest;
import org.baeldung.properties.core.ExternalPropertiesWithXmlIntegrationTest;
import org.baeldung.properties.core.PropertiesWithJavaIntegrationTest;
import org.baeldung.properties.core.PropertiesWithMultipleXmlsIntegrationTest;
import org.baeldung.properties.core.PropertiesWithXmlIntegrationTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({//@formatter:off
PropertiesWithXmlIntegrationTest.class,
ExternalPropertiesWithJavaIntegrationTest.class,
ExternalPropertiesWithMultipleXmlsIntegrationTest.class,
ExternalPropertiesWithXmlIntegrationTest.class,
PropertiesWithJavaIntegrationTest.class,
PropertiesWithMultipleXmlsIntegrationTest.class,
})// @formatter:on
public final class IntegrationTestSuite {
//
}