Skip to content

Commit 7400fdf

Browse files
author
eugenp
committed
cleanup work
1 parent 71ffd8f commit 7400fdf

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
lines changed

core-java/src/main/resources/targetFile.tmp

Lines changed: 0 additions & 2 deletions
This file was deleted.

core-java/src/test/java/org/baeldung/java/io/JavaInputStreamToXUnitTest.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public final void givenUsingCommonsIO_whenConvertingAnInputStreamToAByteArray_th
149149
// tests - InputStream to File
150150

151151
@Test
152-
public final void givenUsingPlainJava_whenConvertingAnInputStreamToAFile_thenCorrect() throws IOException {
152+
public final void givenUsingPlainJava_whenConvertingAnFullInputStreamToAFile_thenCorrect() throws IOException {
153153
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
154154
final byte[] buffer = new byte[initialStream.available()];
155155
initialStream.read(buffer);
@@ -162,6 +162,22 @@ public final void givenUsingPlainJava_whenConvertingAnInputStreamToAFile_thenCor
162162
IOUtils.closeQuietly(outStream);
163163
}
164164

165+
@Test
166+
public final void givenUsingPlainJava_whenConvertingAnInProgressInputStreamToAFile_thenCorrect() throws IOException {
167+
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));
168+
final File targetFile = new File("src/main/resources/targetFile.tmp");
169+
final OutputStream outStream = new FileOutputStream(targetFile);
170+
171+
final byte[] buffer = new byte[8 * 1024];
172+
int bytesRead;
173+
while ((bytesRead = initialStream.read(buffer)) != -1) {
174+
outStream.write(buffer, 0, bytesRead);
175+
}
176+
177+
IOUtils.closeQuietly(initialStream);
178+
IOUtils.closeQuietly(outStream);
179+
}
180+
165181
@Test
166182
public final void givenUsingGuava_whenConvertingAnInputStreamToAFile_thenCorrect() throws IOException {
167183
final InputStream initialStream = new FileInputStream(new File("src/main/resources/sample.txt"));

spring-all/src/test/java/org/baeldung/properties/core/ExternalPropertiesWithJavaIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.baeldung.properties.spring.PropertiesWithJavaConfig;
44
import org.baeldung.properties.spring.PropertiesWithJavaConfigOther;
5+
import org.junit.Ignore;
56
import org.junit.Test;
67
import org.junit.runner.RunWith;
78
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +14,7 @@
1314

1415
@RunWith(SpringJUnit4ClassRunner.class)
1516
@ContextConfiguration(classes = { PropertiesWithJavaConfig.class, PropertiesWithJavaConfigOther.class }, loader = AnnotationConfigContextLoader.class)
17+
@Ignore("manual only")
1618
public class ExternalPropertiesWithJavaIntegrationTest {
1719

1820
@Autowired

spring-all/src/test/java/org/baeldung/properties/core/ExternalPropertiesWithMultipleXmlsIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.baeldung.properties.spring.PropertiesWithXmlConfigOne;
44
import org.baeldung.properties.spring.PropertiesWithXmlConfigTwo;
5+
import org.junit.Ignore;
56
import org.junit.Test;
67
import org.junit.runner.RunWith;
78
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +14,7 @@
1314

1415
@RunWith(SpringJUnit4ClassRunner.class)
1516
@ContextConfiguration(classes = { PropertiesWithXmlConfigOne.class, PropertiesWithXmlConfigTwo.class }, loader = AnnotationConfigContextLoader.class)
17+
@Ignore("manual only")
1618
public class ExternalPropertiesWithMultipleXmlsIntegrationTest {
1719

1820
@Autowired

spring-all/src/test/java/org/baeldung/properties/core/ExternalPropertiesWithXmlIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.baeldung.properties.core;
22

33
import org.baeldung.properties.spring.PropertiesWithXmlConfig;
4+
import org.junit.Ignore;
45
import org.junit.Test;
56
import org.junit.runner.RunWith;
67
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,6 +13,7 @@
1213

1314
@RunWith(SpringJUnit4ClassRunner.class)
1415
@ContextConfiguration(classes = { PropertiesWithXmlConfig.class }, loader = AnnotationConfigContextLoader.class)
16+
@Ignore("manual only")
1517
public class ExternalPropertiesWithXmlIntegrationTest {
1618

1719
@Autowired
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.baeldung.test;
2+
3+
import org.baeldung.properties.core.ExternalPropertiesWithJavaIntegrationTest;
4+
import org.baeldung.properties.core.ExternalPropertiesWithMultipleXmlsIntegrationTest;
5+
import org.baeldung.properties.core.ExternalPropertiesWithXmlIntegrationTest;
6+
import org.baeldung.properties.core.PropertiesWithJavaIntegrationTest;
7+
import org.baeldung.properties.core.PropertiesWithMultipleXmlsIntegrationTest;
8+
import org.baeldung.properties.core.PropertiesWithXmlIntegrationTest;
9+
import org.junit.runner.RunWith;
10+
import org.junit.runners.Suite;
11+
import org.junit.runners.Suite.SuiteClasses;
12+
13+
@RunWith(Suite.class)
14+
@SuiteClasses({//@formatter:off
15+
PropertiesWithXmlIntegrationTest.class,
16+
ExternalPropertiesWithJavaIntegrationTest.class,
17+
ExternalPropertiesWithMultipleXmlsIntegrationTest.class,
18+
ExternalPropertiesWithXmlIntegrationTest.class,
19+
PropertiesWithJavaIntegrationTest.class,
20+
PropertiesWithMultipleXmlsIntegrationTest.class,
21+
})// @formatter:on
22+
public final class IntegrationTestSuite {
23+
//
24+
}

0 commit comments

Comments
 (0)