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/*-JMeter*.csv
|
||||||
jmeter/src/main/resources/*ReportsDashboard*.csv
|
jmeter/src/main/resources/*ReportsDashboard*.csv
|
||||||
jmeter/src/main/resources/dashboard/*ReportsDashboard*.csv
|
jmeter/src/main/resources/dashboard/*ReportsDashboard*.csv
|
||||||
|
jmeter/src/main/resources/*FileExtractionExample.csv
|
||||||
|
|
||||||
ninja/devDb.mv.db
|
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/node
|
||||||
spring-boot-modules/spring-boot-react/frontend/yarn.lock
|
spring-boot-modules/spring-boot-react/frontend/yarn.lock
|
||||||
spring-boot-modules/spring-boot-properties-3/*.log
|
spring-boot-modules/spring-boot-properties-3/*.log
|
||||||
|
spring-boot-modules/spring-boot-properties-3/*.gz
|
||||||
|
|
||||||
# SDKMan
|
# SDKMan
|
||||||
.sdkmanrc
|
.sdkmanrc
|
||||||
|
@ -115,3 +117,6 @@ libraries-2/src/test/resources/crawler4j/**
|
||||||
|
|
||||||
#web-modules/ninja
|
#web-modules/ninja
|
||||||
devDb*.db
|
devDb*.db
|
||||||
|
|
||||||
|
#jaxb
|
||||||
|
*.xjb
|
|
@ -7,12 +7,14 @@ public class DataStream {
|
||||||
PrintStream out = new PrintStream(fileName);
|
PrintStream out = new PrintStream(fileName);
|
||||||
out.print(content);
|
out.print(content);
|
||||||
out.flush();
|
out.flush();
|
||||||
|
out.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void textDataProcessingCharStream(String fileName, String content) throws IOException {
|
public static void textDataProcessingCharStream(String fileName, String content) throws IOException {
|
||||||
PrintWriter out = new PrintWriter(fileName);
|
PrintWriter out = new PrintWriter(fileName);
|
||||||
out.print(content);
|
out.print(content);
|
||||||
out.flush();
|
out.flush();
|
||||||
|
out.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void nonTextDataProcessing(String fileName, String streamOutputFile, String writerOutputFile) throws IOException {
|
public static void nonTextDataProcessing(String fileName, String streamOutputFile, String writerOutputFile) throws IOException {
|
||||||
|
@ -33,5 +35,6 @@ public class DataStream {
|
||||||
writer.write(c);
|
writer.write(c);
|
||||||
}
|
}
|
||||||
writer.close();
|
writer.close();
|
||||||
|
inputStream.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,32 +23,29 @@ public class DataStreamUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenUsingByteStream_thenWriteTextToFile() throws IOException {
|
public void whenUsingByteStream_thenWriteTextToFile() throws IOException {
|
||||||
DataStream dataStream = new DataStream();
|
DataStream.textDataProcessingByteStream(dataProcessingTextFile, textFileContent);
|
||||||
dataStream.textDataProcessingByteStream(dataProcessingTextFile, textFileContent);
|
|
||||||
|
|
||||||
File file = new File(dataProcessingTextFile);
|
File file = new File(dataProcessingTextFile);
|
||||||
assertTrue(file.exists());
|
assertTrue(file.exists());
|
||||||
assertEquals(textFileContent, FileUtils.readFileToString(file, "utf-8"));
|
assertEquals(textFileContent, FileUtils.readFileToString(file, "utf-8"));
|
||||||
|
|
||||||
Files.delete(Paths.get(dataProcessingTextFile));
|
Files.deleteIfExists(Paths.get(dataProcessingTextFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenUsingCharStream_thenWriteTextToFile() throws IOException {
|
public void whenUsingCharStream_thenWriteTextToFile() throws IOException {
|
||||||
DataStream dataStream = new DataStream();
|
DataStream.textDataProcessingCharStream(dataProcessingTextFile, textFileContent);
|
||||||
dataStream.textDataProcessingCharStream(dataProcessingTextFile, textFileContent);
|
|
||||||
|
|
||||||
File file = new File(dataProcessingTextFile);
|
File file = new File(dataProcessingTextFile);
|
||||||
assertTrue(file.exists());
|
assertTrue(file.exists());
|
||||||
assertEquals(textFileContent, FileUtils.readFileToString(file, "utf-8"));
|
assertEquals(textFileContent, FileUtils.readFileToString(file, "utf-8"));
|
||||||
|
|
||||||
Files.delete(Paths.get(dataProcessingTextFile));
|
Files.deleteIfExists(Paths.get(dataProcessingTextFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenUsingStreams_thenWriteNonTextData() throws IOException {
|
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 file = new File(dataProcessingImageFile);
|
||||||
File byteStreamOutputFile = new File(dataProcessingByteStreamFile);
|
File byteStreamOutputFile = new File(dataProcessingByteStreamFile);
|
||||||
|
@ -60,7 +57,7 @@ public class DataStreamUnitTest {
|
||||||
assertTrue(FileUtils.contentEquals(file, byteStreamOutputFile));
|
assertTrue(FileUtils.contentEquals(file, byteStreamOutputFile));
|
||||||
assertFalse(FileUtils.contentEquals(file, charStreamOutputFile));
|
assertFalse(FileUtils.contentEquals(file, charStreamOutputFile));
|
||||||
|
|
||||||
Files.delete(Paths.get(dataProcessingByteStreamFile));
|
Files.deleteIfExists(Paths.get(dataProcessingByteStreamFile));
|
||||||
Files.delete(Paths.get(dataProcessingCharStreamFile));
|
Files.deleteIfExists(Paths.get(dataProcessingCharStreamFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@ import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
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.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
@ -25,7 +26,7 @@ public class BinaryFileDownloaderIntegrationTest {
|
||||||
String fileName = "download.txt";
|
String fileName = "download.txt";
|
||||||
|
|
||||||
ProgressCallback progressCallback = progress -> assertEquals(100.0, progress, .0);
|
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());
|
long downloaded = tested.download(server.url("/greetings").toString());
|
||||||
assertEquals(body.length(), downloaded);
|
assertEquals(body.length(), downloaded);
|
||||||
File downloadedFile = new File(fileName);
|
File downloadedFile = new File(fileName);
|
||||||
|
|
Loading…
Reference in New Issue