Skip to content

Commit 56913b9

Browse files
github-actionsgithub-actions
authored andcommitted
Formatted with Google Java Formatter
1 parent d80c742 commit 56913b9

15 files changed

+35
-51
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class BufferInputStreamExample {
4-
}
3+
public class BufferInputStreamExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class BufferReaderExample {
4-
}
3+
public class BufferReaderExample {}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class DataInputStreamExample {
4-
5-
}
3+
public class DataInputStreamExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class DataOutputStreamExample {
4-
}
3+
public class DataOutputStreamExample {}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
package com.examplehub.basics.io;
22

3-
public class PrintStreamExample {
4-
}
3+
public class PrintStreamExample {}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package com.examplehub.basics.io;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.io.*;
66
import java.nio.file.Files;
77
import java.nio.file.Paths;
8-
9-
import static org.junit.jupiter.api.Assertions.*;
8+
import org.junit.jupiter.api.Test;
109

1110
class BufferInputStreamExampleTest {
1211
@Test
1312
void testCopyFile() throws IOException {
1413
String filename = "pom.xml";
1514
String newFileName = "pom_bk.xml";
1615
try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(filename));
17-
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(newFileName))) {
16+
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(newFileName))) {
1817
byte[] buffer = new byte[1024];
1918
int readBytes;
2019
while ((readBytes = bis.read(buffer)) != -1) {
@@ -25,4 +24,4 @@ void testCopyFile() throws IOException {
2524
}
2625
assertTrue(Files.deleteIfExists(Paths.get(newFileName)));
2726
}
28-
}
27+
}

src/test/java/com/examplehub/basics/io/BufferReaderExampleTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package com.examplehub.basics.io;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.io.*;
66
import java.nio.file.Files;
77
import java.nio.file.Paths;
8-
9-
import static org.junit.jupiter.api.Assertions.*;
8+
import org.junit.jupiter.api.Test;
109

1110
class BufferReaderExampleTest {
1211
@Test
1312
void testCopyFile() throws IOException {
1413
String filename = "pom.xml";
1514
String newFileName = "pom_bk.xml";
1615
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(filename));
17-
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(newFileName))) {
16+
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(newFileName))) {
1817
String line = bufferedReader.readLine();
1918
while (line != null) {
2019
String nextLine = bufferedReader.readLine();
@@ -29,4 +28,4 @@ void testCopyFile() throws IOException {
2928
}
3029
assertTrue(Files.deleteIfExists(Paths.get(newFileName)));
3130
}
32-
}
31+
}

src/test/java/com/examplehub/basics/io/CreateFolderTest.java

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

33
import static org.junit.jupiter.api.Assertions.*;
44

5-
6-
import com.examplehub.basics.io.CreateFolder;
7-
85
import org.junit.jupiter.api.Disabled;
96
import org.junit.jupiter.api.Test;
107

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
package com.examplehub.basics.io;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.io.*;
66
import java.nio.file.Files;
77
import java.nio.file.Paths;
8-
9-
import static org.junit.jupiter.api.Assertions.*;
8+
import org.junit.jupiter.api.Test;
109

1110
class DataInputStreamExampleTest {
1211
@Test
1312
void testRead() throws IOException {
1413
String filename = "example.txt";
1514
try (DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(filename));
16-
DataInputStream dataInputStream = new DataInputStream(new FileInputStream(filename))) {
15+
DataInputStream dataInputStream = new DataInputStream(new FileInputStream(filename))) {
1716
dataOutputStream.writeInt(97);
1817
dataOutputStream.flush();
1918

2019
assertEquals(97, dataInputStream.readInt());
2120
}
2221
assertTrue(Files.deleteIfExists(Paths.get(filename)));
2322
}
24-
}
23+
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
package com.examplehub.basics.io;
22

3-
import org.junit.jupiter.api.Test;
3+
import static org.junit.jupiter.api.Assertions.*;
44

55
import java.io.DataOutputStream;
66
import java.io.FileOutputStream;
77
import java.io.IOException;
88
import java.nio.file.Files;
99
import java.nio.file.Paths;
10-
11-
import static org.junit.jupiter.api.Assertions.*;
10+
import org.junit.jupiter.api.Test;
1211

1312
class DataOutputStreamExampleTest {
1413
@Test
1514
void testWriteInt() throws IOException {
1615
String filename = "example.txt";
17-
try(DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(filename))) {
16+
try (DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(filename))) {
1817
dataOutputStream.writeInt(97);
1918
}
2019
assertTrue(Files.deleteIfExists(Paths.get(filename)));
2120
}
22-
}
21+
}

0 commit comments

Comments
 (0)