Skip to content

Commit

Permalink
Code refactoring and maven dependency clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Jan 3, 2024
1 parent 3e1e51e commit 4631a91
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 316 deletions.
170 changes: 57 additions & 113 deletions source/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<jsonxpath.version>2.7.0</jsonxpath.version>
<!-- Groovy Version -->
<groovy.version>3.0.11</groovy.version>
<groovy-dateutil.version>3.0.11</groovy-dateutil.version>
<!-- <groovy-dateutil.version>3.0.11</groovy-dateutil.version>-->
<groovy-sandbox.version>1.19</groovy-sandbox.version>
<!-- Appium/Selenium scope Version -->
<appium.version>7.2.0</appium.version>
Expand All @@ -62,36 +62,14 @@
<sftm-tree-matching.version>1.1.0</sftm-tree-matching.version>
<!-- Loggers -->
<log4j.version>2.17.2</log4j.version>
<slf4j.version>1.7.26</slf4j.version>
<!-- Compile scope -->
<javaee-web-api>8.0.1</javaee-web-api>
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
<javax.websocket-api>1.1</javax.websocket-api>
<guava.version>32.1.3-jre</guava.version>
<xmlunit.version>1.5</xmlunit.version>
<owasp-java-html-sanitizer.version>20211018.1</owasp-java-html-sanitizer.version>
<jcommon.version>1.0.16</jcommon.version>
<commons-fileupload.version>1.5</commons-fileupload.version>
<commons-io.version>2.7</commons-io.version>
<commons-net.version>3.9.0</commons-net.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-collections4.version>4.4</commons-collections4.version>
<java-image-scaling.version>0.8.5</java-image-scaling.version>
<commons-email.version>1.5</commons-email.version>
<commons-text.version>1.3</commons-text.version>
<poi.version>4.1.2</poi.version>
<asciidoctor.version>2.1.0</asciidoctor.version>
<apache.tika.version>1.28.3</apache.tika.version>
<fluent-hc.version>4.5.14</fluent-hc.version>
<httpmime.version>4.5.14</httpmime.version>

<!-- 2FA -->
<!-- <slf4j.version>1.7.26</slf4j.version>-->
<!-- OTP Support -->
<jboss.aerogear.version>1.0.0</jboss.aerogear.version>
<!-- SOAP -->
<javax.xml.soap.version>1.4.0</javax.xml.soap.version>
<jaxb.version>2.3.0</jaxb.version>
<saaj.version>1.5.1</saaj.version>
<jaxws.version>2.2.6</jaxws.version>
<!-- <saaj.version>1.5.1</saaj.version>-->
<!-- <jaxws.version>2.2.6</jaxws.version>-->
<!-- Kafka -->
<kafka-clients.version>2.6.3</kafka-clients.version>
<kafka-avro-serializer.version>6.2.1</kafka-avro-serializer.version>
Expand All @@ -104,11 +82,31 @@
<mapstruct.version>1.4.2.Final</mapstruct.version>
<!-- Swagger generator -->
<springfox.version>2.9.2</springfox.version>
<!-- REST API Calls -->
<httpmime.version>4.5.14</httpmime.version>
<!-- Compile scope -->
<javaee-web-api>8.0.1</javaee-web-api>
<!-- <javax.servlet-api.version>4.0.1</javax.servlet-api.version>-->
<!-- <javax.websocket-api>1.1</javax.websocket-api>-->
<!-- <guava.version>32.1.3-jre</guava.version>-->
<xmlunit.version>1.5</xmlunit.version>
<owasp-java-html-sanitizer.version>20211018.1</owasp-java-html-sanitizer.version>
<commons-fileupload.version>1.5</commons-fileupload.version>
<commons-io.version>2.7</commons-io.version>
<commons-net.version>3.9.0</commons-net.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-collections4.version>4.4</commons-collections4.version>
<java-image-scaling.version>0.8.5</java-image-scaling.version>
<commons-email.version>1.5</commons-email.version>
<commons-text.version>1.3</commons-text.version>
<!-- <poi.version>4.1.2</poi.version>-->
<apache.tika.version>1.28.3</apache.tika.version>
<!-- <fluent-hc.version>4.5.14</fluent-hc.version>-->

<!-- Test scope -->
<junit.version>4.12</junit.version>
<powermock.version>1.5.2</powermock.version>
<mockito-all.version>1.9.5</mockito-all.version>
<!-- <junit.version>4.12</junit.version>-->
<!-- <powermock.version>1.5.2</powermock.version>-->
<!-- <mockito-all.version>1.9.5</mockito-all.version>-->

<!-- Maven plugin version -->
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
Expand Down Expand Up @@ -295,16 +293,6 @@
</dependency>

<!-- Log4J -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down Expand Up @@ -346,18 +334,14 @@
<scope>compile</scope>
</dependency>

<!-- Compile scope -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<type>pom</type>
</dependency>
<!-- Erratum Tree matching -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<groupId>io.github.amaris</groupId>
<artifactId>sftm-tree-matching</artifactId>
<version>${sftm-tree-matching.version}</version>
</dependency>

<!-- Compile scope -->
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
Expand All @@ -368,7 +352,18 @@
<artifactId>jaxb-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<!-- <dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>${jaxws.version}</version>
</dependency>-->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>${javaee-web-api}</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.version}</version>
Expand All @@ -377,29 +372,13 @@
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
</dependency>-->
<!-- <dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>${saaj.version}</version>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>${jaxws.version}</version>
</dependency>
<dependency>
<groupId>io.github.amaris</groupId>
<artifactId>sftm-tree-matching</artifactId>
<version>${sftm-tree-matching.version}</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>${javaee-web-api}</version>
<scope>provided</scope>
</dependency>
<dependency>
</dependency>-->
<!-- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet-api.version}</version>
Expand All @@ -409,12 +388,12 @@
<artifactId>javax.websocket-api</artifactId>
<version>${javax.websocket-api}</version>
<scope>provided</scope>
</dependency>
<dependency>
</dependency>-->
<!-- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
</dependency>-->
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
Expand All @@ -425,11 +404,6 @@
<artifactId>owasp-java-html-sanitizer</artifactId>
<version>${owasp-java-html-sanitizer.version}</version>
</dependency>
<dependency>
<groupId>jfree</groupId>
<artifactId>jcommon</artifactId>
<version>${jcommon.version}</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
Expand Down Expand Up @@ -470,7 +444,7 @@
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<!-- <dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
Expand All @@ -479,22 +453,17 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>${asciidoctor.version}</version>
</dependency>
</dependency>-->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>${apache.tika.version}</version>
</dependency>
<dependency>
<!-- <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>${fluent-hc.version}</version>
</dependency>
</dependency>-->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
Expand Down Expand Up @@ -536,36 +505,11 @@
<artifactId>layout</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>forms</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>pdfa</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>sign</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>barcodes</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>font-asian</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>hyph</artifactId>
<version>${com.itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>html2pdf</artifactId>
Expand Down Expand Up @@ -673,7 +617,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<!-- <release>${java.version}</release>-->
<!-- <release>${java.version}</release>-->
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ public TestCaseExecutionFile recordPicture(TestCaseStepActionExecution actionExe
File newImage = new File(recorder.getFullFilename());
OutputStream outStream = new FileOutputStream(newImage);
outStream.write(bytes);
IOUtils.close(outStream);
outStream.close();
// IOUtils.close(outStream);

// Index file created to database.
object = testCaseExecutionFileFactory.create(0, runId, recorder.getLevel(), "Picture " + valueFieldName, recorder.getRelativeFilenameURL(), "PNG", "", null, "", null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
package org.cerberus.core.servlet.crud.testexecution;

import com.google.common.io.Files;
import com.mortennobel.imagescaling.DimensionConstrain;
import com.mortennobel.imagescaling.ResampleOp;
import java.awt.image.BufferedImage;
Expand Down Expand Up @@ -50,7 +49,6 @@
import org.cerberus.core.util.StringUtil;
import org.cerberus.core.util.answer.AnswerList;
import org.cerberus.core.util.servlet.ServletUtil;
import org.jfree.util.Log;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

Expand Down Expand Up @@ -285,9 +283,9 @@ private void returnPDF(HttpServletRequest request, HttpServletResponse response,
response.setContentType("application/pdf");
response.setContentLength((int) pdfFile.length());
try {
Files.copy(pdfFile, response.getOutputStream());
FileUtils.copyFile(pdfFile, response.getOutputStream());
} catch (IOException e) {
Log.warn(e);
LOG.warn(e);
}

}
Expand All @@ -301,9 +299,9 @@ private void returnMP4(HttpServletRequest request, HttpServletResponse response,
response.setContentLength((int) mp4File.length());
response.setHeader("Content-Range", "bytes start-end/length");
try {
Files.copy(mp4File, response.getOutputStream());
FileUtils.copyFile(mp4File, response.getOutputStream());
} catch (IOException e) {
Log.warn(e);
LOG.warn(e);
}

}
Expand Down
Loading

0 comments on commit 4631a91

Please sign in to comment.