JAVA-19534 Cleanup un-committed or un-ignored artifacts - Week 14 - 2023 (#13695)
Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
parent
1d5d6c562c
commit
be7213b147
|
@ -69,6 +69,7 @@ jmeter/src/main/resources/*-Basic*.csv
|
|||
jmeter/src/main/resources/*-JMeter*.csv
|
||||
jmeter/src/main/resources/*ReportsDashboard*.csv
|
||||
jmeter/src/main/resources/dashboard/*ReportsDashboard*.csv
|
||||
jmeter/src/main/resources/*FileExtractionExample.csv
|
||||
|
||||
ninja/devDb.mv.db
|
||||
|
||||
|
@ -102,6 +103,7 @@ spring-boot-modules/spring-boot-react/frontend/build
|
|||
spring-boot-modules/spring-boot-react/frontend/node
|
||||
spring-boot-modules/spring-boot-react/frontend/yarn.lock
|
||||
spring-boot-modules/spring-boot-properties-3/*.log
|
||||
spring-boot-modules/spring-boot-properties-3/*.gz
|
||||
|
||||
# SDKMan
|
||||
.sdkmanrc
|
||||
|
@ -114,4 +116,7 @@ libraries-2/employee*
|
|||
libraries-2/src/test/resources/crawler4j/**
|
||||
|
||||
#web-modules/ninja
|
||||
devDb*.db
|
||||
devDb*.db
|
||||
|
||||
#jaxb
|
||||
*.xjb
|
|
@ -7,12 +7,14 @@ public class DataStream {
|
|||
PrintStream out = new PrintStream(fileName);
|
||||
out.print(content);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
public static void textDataProcessingCharStream(String fileName, String content) throws IOException {
|
||||
PrintWriter out = new PrintWriter(fileName);
|
||||
out.print(content);
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
public static void nonTextDataProcessing(String fileName, String streamOutputFile, String writerOutputFile) throws IOException {
|
||||
|
@ -33,5 +35,6 @@ public class DataStream {
|
|||
writer.write(c);
|
||||
}
|
||||
writer.close();
|
||||
inputStream.close();
|
||||
}
|
||||
}
|
|
@ -23,32 +23,29 @@ public class DataStreamUnitTest {
|
|||
|
||||
@Test
|
||||
public void whenUsingByteStream_thenWriteTextToFile() throws IOException {
|
||||
DataStream dataStream = new DataStream();
|
||||
dataStream.textDataProcessingByteStream(dataProcessingTextFile, textFileContent);
|
||||
DataStream.textDataProcessingByteStream(dataProcessingTextFile, textFileContent);
|
||||
|
||||
File file = new File(dataProcessingTextFile);
|
||||
assertTrue(file.exists());
|
||||
assertEquals(textFileContent, FileUtils.readFileToString(file, "utf-8"));
|
||||
|
||||
Files.delete(Paths.get(dataProcessingTextFile));
|
||||
Files.deleteIfExists(Paths.get(dataProcessingTextFile));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenUsingCharStream_thenWriteTextToFile() throws IOException {
|
||||
DataStream dataStream = new DataStream();
|
||||
dataStream.textDataProcessingCharStream(dataProcessingTextFile, textFileContent);
|
||||
DataStream.textDataProcessingCharStream(dataProcessingTextFile, textFileContent);
|
||||
|
||||
File file = new File(dataProcessingTextFile);
|
||||
assertTrue(file.exists());
|
||||
assertEquals(textFileContent, FileUtils.readFileToString(file, "utf-8"));
|
||||
|
||||
Files.delete(Paths.get(dataProcessingTextFile));
|
||||
Files.deleteIfExists(Paths.get(dataProcessingTextFile));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenUsingStreams_thenWriteNonTextData() throws IOException {
|
||||
DataStream dataStream = new DataStream();
|
||||
dataStream.nonTextDataProcessing(dataProcessingImageFile, dataProcessingByteStreamFile, dataProcessingCharStreamFile);
|
||||
DataStream.nonTextDataProcessing(dataProcessingImageFile, dataProcessingByteStreamFile, dataProcessingCharStreamFile);
|
||||
|
||||
File file = new File(dataProcessingImageFile);
|
||||
File byteStreamOutputFile = new File(dataProcessingByteStreamFile);
|
||||
|
@ -60,7 +57,7 @@ public class DataStreamUnitTest {
|
|||
assertTrue(FileUtils.contentEquals(file, byteStreamOutputFile));
|
||||
assertFalse(FileUtils.contentEquals(file, charStreamOutputFile));
|
||||
|
||||
Files.delete(Paths.get(dataProcessingByteStreamFile));
|
||||
Files.delete(Paths.get(dataProcessingCharStreamFile));
|
||||
Files.deleteIfExists(Paths.get(dataProcessingByteStreamFile));
|
||||
Files.deleteIfExists(Paths.get(dataProcessingCharStreamFile));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ import org.junit.Rule;
|
|||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -25,7 +26,7 @@ public class BinaryFileDownloaderIntegrationTest {
|
|||
String fileName = "download.txt";
|
||||
|
||||
ProgressCallback progressCallback = progress -> assertEquals(100.0, progress, .0);
|
||||
try (BinaryFileWriter writer = new BinaryFileWriter(new FileOutputStream(fileName), progressCallback); BinaryFileDownloader tested = new BinaryFileDownloader(new OkHttpClient(), writer)) {
|
||||
try (BinaryFileWriter writer = new BinaryFileWriter(Files.newOutputStream(Paths.get(fileName)), progressCallback); BinaryFileDownloader tested = new BinaryFileDownloader(new OkHttpClient(), writer)) {
|
||||
long downloaded = tested.download(server.url("/greetings").toString());
|
||||
assertEquals(body.length(), downloaded);
|
||||
File downloadedFile = new File(fileName);
|
||||
|
|
Loading…
Reference in New Issue