cleanup work
This commit is contained in:
parent
71ffd8fb58
commit
7400fdff98
|
@ -1,2 +0,0 @@
|
||||||
line 1
|
|
||||||
a second line
|
|
|
@ -149,7 +149,7 @@ public class JavaInputStreamToXUnitTest {
|
||||||
// tests - InputStream to File
|
// tests - InputStream to File
|
||||||
|
|
||||||
@Test
|
@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 InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
|
||||||
final byte[] buffer = new byte[initialStream.available()];
|
final byte[] buffer = new byte[initialStream.available()];
|
||||||
initialStream.read(buffer);
|
initialStream.read(buffer);
|
||||||
|
@ -162,6 +162,22 @@ public class JavaInputStreamToXUnitTest {
|
||||||
IOUtils.closeQuietly(outStream);
|
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
|
@Test
|
||||||
public final void givenUsingGuava_whenConvertingAnInputStreamToAFile_thenCorrect() throws IOException {
|
public final void givenUsingGuava_whenConvertingAnInputStreamToAFile_thenCorrect() throws IOException {
|
||||||
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
|
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.baeldung.properties.core;
|
||||||
|
|
||||||
import org.baeldung.properties.spring.PropertiesWithJavaConfig;
|
import org.baeldung.properties.spring.PropertiesWithJavaConfig;
|
||||||
import org.baeldung.properties.spring.PropertiesWithJavaConfigOther;
|
import org.baeldung.properties.spring.PropertiesWithJavaConfigOther;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -13,6 +14,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration(classes = { PropertiesWithJavaConfig.class, PropertiesWithJavaConfigOther.class }, loader = AnnotationConfigContextLoader.class)
|
@ContextConfiguration(classes = { PropertiesWithJavaConfig.class, PropertiesWithJavaConfigOther.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
|
@Ignore("manual only")
|
||||||
public class ExternalPropertiesWithJavaIntegrationTest {
|
public class ExternalPropertiesWithJavaIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.baeldung.properties.core;
|
||||||
|
|
||||||
import org.baeldung.properties.spring.PropertiesWithXmlConfigOne;
|
import org.baeldung.properties.spring.PropertiesWithXmlConfigOne;
|
||||||
import org.baeldung.properties.spring.PropertiesWithXmlConfigTwo;
|
import org.baeldung.properties.spring.PropertiesWithXmlConfigTwo;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -13,6 +14,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration(classes = { PropertiesWithXmlConfigOne.class, PropertiesWithXmlConfigTwo.class }, loader = AnnotationConfigContextLoader.class)
|
@ContextConfiguration(classes = { PropertiesWithXmlConfigOne.class, PropertiesWithXmlConfigTwo.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
|
@Ignore("manual only")
|
||||||
public class ExternalPropertiesWithMultipleXmlsIntegrationTest {
|
public class ExternalPropertiesWithMultipleXmlsIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.baeldung.properties.core;
|
package org.baeldung.properties.core;
|
||||||
|
|
||||||
import org.baeldung.properties.spring.PropertiesWithXmlConfig;
|
import org.baeldung.properties.spring.PropertiesWithXmlConfig;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -12,6 +13,7 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration(classes = { PropertiesWithXmlConfig.class }, loader = AnnotationConfigContextLoader.class)
|
@ContextConfiguration(classes = { PropertiesWithXmlConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
|
@Ignore("manual only")
|
||||||
public class ExternalPropertiesWithXmlIntegrationTest {
|
public class ExternalPropertiesWithXmlIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
@ -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 {
|
||||||
|
//
|
||||||
|
}
|
Loading…
Reference in New Issue