Skip to content

Commit

Permalink
Changed package name of test classes and jars
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes authored and tcurdt committed Nov 21, 2023
1 parent 4d97e14 commit 46cb42e
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 37 deletions.
38 changes: 19 additions & 19 deletions src/test/java/org/vafer/jdependency/ClazzpathUnitTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,20 @@ private void verifyFileNameParsingInvalid(String fileName) {

@Test
public void testFileNameCheck(){
assertFalse(Clazz.isMultiReleaseClassFile("nl/basjes/maven/multijdk/App.class"));
assertTrue(Clazz.isMultiReleaseClassFile("META-INF/versions/11/nl/basjes/maven/multijdk/App.class"));
assertTrue(Clazz.isMultiReleaseClassFile("META-INF/versions/1234/nl/basjes/maven/multijdk/App.class"));
assertFalse(Clazz.isMultiReleaseClassFile("org/vafer/multijdk/App.class"));
assertTrue(Clazz.isMultiReleaseClassFile("META-INF/versions/11/org/vafer/multijdk/App.class"));
assertTrue(Clazz.isMultiReleaseClassFile("META-INF/versions/1234/org/vafer/multijdk/App.class"));
}

@Test
public void testFileNameParsing(){
verifyFileNameParsing("nl/basjes/maven/multijdk/App.class", "8", "nl.basjes.maven.multijdk.App");
verifyFileNameParsing("META-INF/versions/11/nl/basjes/maven/multijdk/App.class", "11", "nl.basjes.maven.multijdk.App");
verifyFileNameParsing("META-INF/versions/1234/nl/basjes/maven/multijdk/App.class", "1234", "nl.basjes.maven.multijdk.App");
verifyFileNameParsing("org/vafer/multijdk/App.class", "8", "org.vafer.multijdk.App");
verifyFileNameParsing("META-INF/versions/11/org/vafer/multijdk/App.class", "11", "org.vafer.multijdk.App");
verifyFileNameParsing("META-INF/versions/1234/org/vafer/multijdk/App.class", "1234", "org.vafer.multijdk.App");

verifyFileNameParsingInvalid("nl/basjes/maven/multijdk/App.classsssss");
verifyFileNameParsingInvalid("nl/basjes/maven/multijdk/App.txt");
verifyFileNameParsingInvalid("META-INF/versions/xxx/nl/basjes/maven/multijdk/App.class");
verifyFileNameParsingInvalid("org/vafer/multijdk/App.classsssss");
verifyFileNameParsingInvalid("org/vafer/multijdk/App.txt");
verifyFileNameParsingInvalid("META-INF/versions/xxx/org/vafer/multijdk/App.class");
}

private void verifyFileInClazz(Clazz clazz, String expectedFilename, String forJava, boolean mustBePresent) {
Expand Down Expand Up @@ -254,14 +254,14 @@ public void testMultiReleaseJar() throws IOException {
final ClazzpathUnit dependency = cp.addClazzpathUnit(resourceFile("multi-jdk-1.0.0.jar"));
Map<String, Clazz> dependencyClazzes = dependency.getClazzesMap();
// Java 8, Java 11, Java 17
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.Main"), true, false, false);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.App"), true, true, true);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.AbstractJavaVersion"), true, false, false);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.JavaVersion"), true, true, false);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.Unused"), true, true, true);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.OnlyUsedInJava17"), false, true, false);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.SpecificToJava11"), false, true, false);
verifyClazzFiles(dependencyClazzes.get("nl.basjes.maven.multijdk.SpecificToJava17"), false, false, true);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.Main"), true, false, false);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.App"), true, true, true);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.AbstractJavaVersion"), true, false, false);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.JavaVersion"), true, true, false);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.Unused"), true, true, true);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.OnlyUsedInJava17"), false, true, false);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.SpecificToJava11"), false, true, false);
verifyClazzFiles(dependencyClazzes.get("org.vafer.multijdk.SpecificToJava17"), false, false, true);

// Check which are obsolete
final Set<Clazz> removable = cp.getClazzes();
Expand All @@ -273,8 +273,8 @@ public void testMultiReleaseJar() throws IOException {
.collect(Collectors.toMap(Clazz::getName, Function.identity()));

assertEquals(2, removableClazzes.size());
assertTrue(removableClazzes.containsKey("nl.basjes.maven.multijdk.Main"));
assertTrue(removableClazzes.containsKey("nl.basjes.maven.multijdk.Unused"));
assertTrue(removableClazzes.containsKey("org.vafer.multijdk.Main"));
assertTrue(removableClazzes.containsKey("org.vafer.multijdk.Unused"));
}

}
4 changes: 2 additions & 2 deletions src/test/resources-src/multi-jdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<name>Multi Release Jar</name>

<groupId>nl.basjes.maven</groupId>
<groupId>org.vafer</groupId>
<artifactId>multi-jdk</artifactId>
<version>1.0.0</version>

Expand Down Expand Up @@ -85,7 +85,7 @@
<configuration>
<archive>
<manifest>
<mainClass>nl.basjes.maven.multijdk.Main</mainClass>
<mainClass>org.vafer.multijdk.Main</mainClass>
</manifest>
<manifestEntries>
<Multi-Release>true</Multi-Release>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nl.basjes.maven.multijdk;
package org.vafer.multijdk;
/*
* Copyright 2010-2023 The jdependency developers.
*
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources-src/uses-multi-jdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<dependencies>
<dependency>
<groupId>nl.basjes.maven</groupId>
<groupId>org.vafer</groupId>
<artifactId>multi-jdk</artifactId>
<version>1.0.0</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import nl.basjes.maven.multijdk.JavaVersion;
import nl.basjes.maven.multijdk.App;
import org.vafer.multijdk.JavaVersion;
import org.vafer.multijdk.App;

public class Main {
public static void main(String[] args) {
Expand Down
Binary file modified src/test/resources/multi-jdk-1.0.0.jar
Binary file not shown.
Binary file modified src/test/resources/uses-multi-jdk-1.0.jar
Binary file not shown.

0 comments on commit 46cb42e

Please sign in to comment.