Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<properties>
<encoding>UTF-8</encoding>
<java.version>1.7</java.version>
<java.version>21</java.version>
<project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
<project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand All @@ -23,13 +23,13 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>1.5.0</version>
<version>3.25.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Empty file modified src/test/jars-content/build-jars.sh
100644 → 100755
Empty file.
Binary file modified src/test/jars-content/example-war/WEB-INF/lib/example.jar
Binary file not shown.
Binary file modified src/test/jars-content/example.jar
Binary file not shown.
Binary file modified src/test/jars-content/example.war
Binary file not shown.
9 changes: 5 additions & 4 deletions src/test/java/io/github/xhanin/jarup/WorkingCopyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ public void should_handle_jar_of_jar_for_write() throws Exception {
public void should_keep_jar_of_inside_untouched() throws Exception {
Path exampleJarUnderTest = getJarUnderTest("example.war");

long jarTimestamp = 1389540958000L;
long jarLength = 1421L;
long jarTimestamp;
long jarLength;
try (WorkingCopy wc = WorkingCopy.prepareFor(exampleJarUnderTest)) {
assertThat(wc.getFile("WEB-INF/lib/example.jar").lastModified()).isEqualTo(jarTimestamp);
assertThat(wc.getFile("WEB-INF/lib/example.jar").length()).isEqualTo(jarLength);
File innerJar = wc.getFile("WEB-INF/lib/example.jar");
jarTimestamp = innerJar.lastModified();
jarLength = innerJar.length();
wc.writeFile("test.txt", "UTF-8", "test");
}

Expand Down