Skip to content

Commit

Permalink
[MWAR-465] Rename empty test classes to clazz
Browse files Browse the repository at this point in the history
Such empty classes are analyzed by dependency:analyze and cause to fail it.
  • Loading branch information
slawekjaranowski committed Jun 10, 2023
1 parent acb0bbb commit ae901c9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected File createClassesDir(String id, boolean empty) throws Exception {
createDir(classesDir);

if (!empty) {
createFile(new File(classesDir + "/sample-servlet.class"));
createFile(new File(classesDir + "/sample-servlet.clazz"));
}

return classesDir;
Expand Down Expand Up @@ -202,9 +202,9 @@ protected void createFile(File testFile) throws Exception {
* <ul>
* <li>classes
* <ul>
* <li>a.class</li>
* <li>b.class</li>
* <li>c.class</li>
* <li>a.clazz</li>
* <li>b.clazz</li>
* <li>c.clazz</li>
* </ul>
* </li>
* <li>lib
Expand Down Expand Up @@ -240,9 +240,9 @@ protected File generateFullOverlayWar(String id) throws Exception {
"jsp/a.jsp",
"jsp/b.jsp",
"jsp/c.jsp",
"WEB-INF/classes/a.class",
"WEB-INF/classes/b.class",
"WEB-INF/classes/c.class",
"WEB-INF/classes/a.clazz",
"WEB-INF/classes/b.clazz",
"WEB-INF/classes/c.clazz",
"WEB-INF/lib/a.jar",
"WEB-INF/lib/b.jar",
"WEB-INF/lib/c.jar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ public void testExplodedWar_WithClasses() throws Exception {
File expectedWebSourceFile = new File(webAppDirectory, "pansit.jsp");
File expectedWebSource2File = new File(webAppDirectory, "org/web/app/last-exile.jsp");
// final name form is <artifactId>-<version>.<type>
File expectedClass = new File(webAppDirectory, "WEB-INF/classes/sample-servlet.class");
File expectedClass = new File(webAppDirectory, "WEB-INF/classes/sample-servlet.clazz");

assertTrue("source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists());
assertTrue("source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists());
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/apache/maven/plugins/war/WarMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public void testAttachClasses() throws Exception {
// validate jar file
File expectedJarFile = new File(outputDir, "simple-classes.jar");
assertJarContent(
expectedJarFile, new String[] {"META-INF/MANIFEST.MF", "sample-servlet.class"}, new String[] {null, null
expectedJarFile, new String[] {"META-INF/MANIFEST.MF", "sample-servlet.clazz"}, new String[] {null, null
});
}

Expand Down Expand Up @@ -502,7 +502,7 @@ public void testAttachClassesWithCustomClassifier() throws Exception {
// validate jar file
File expectedJarFile = new File(outputDir, "simple-mystuff.jar");
assertJarContent(
expectedJarFile, new String[] {"META-INF/MANIFEST.MF", "sample-servlet.class"}, new String[] {null, null
expectedJarFile, new String[] {"META-INF/MANIFEST.MF", "sample-servlet.clazz"}, new String[] {null, null
});
}

Expand Down
36 changes: 18 additions & 18 deletions src/test/java/org/apache/maven/plugins/war/WarOverlaysTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ private void assertScenariOne(String testId, File webAppDirectory) throws Except
"jsp/d/b.jsp",
"jsp/d/c.jsp",
"org/sample/company/test.jsp",
"WEB-INF/classes/a.class",
"WEB-INF/classes/b.class",
"WEB-INF/classes/c.class",
"WEB-INF/classes/a.clazz",
"WEB-INF/classes/b.clazz",
"WEB-INF/classes/c.clazz",
"WEB-INF/lib/a.jar",
"WEB-INF/lib/b.jar",
"WEB-INF/lib/c.jar"
Expand All @@ -266,9 +266,9 @@ private void assertScenariOne(String testId, File webAppDirectory) throws Except
assertOverlayedFile(webAppDirectory, "overlay-full-1", "jsp/d/b.jsp");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "jsp/d/c.jsp");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/web.xml");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/classes/a.class");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/classes/b.class");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/classes/c.class");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/classes/a.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/classes/b.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/classes/c.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/lib/a.jar");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/lib/b.jar");
assertOverlayedFile(webAppDirectory, "overlay-full-1", "WEB-INF/lib/c.jar");
Expand Down Expand Up @@ -327,9 +327,9 @@ public void testOverlaysIncludesExcludesWithMultipleDefinitions() throws Excepti
"jsp/d/b.jsp",
"jsp/d/c.jsp",
"org/sample/company/test.jsp",
"WEB-INF/classes/a.class",
"WEB-INF/classes/b.class",
"WEB-INF/classes/c.class",
"WEB-INF/classes/a.clazz",
"WEB-INF/classes/b.clazz",
"WEB-INF/classes/c.clazz",
"WEB-INF/lib/a.jar",
"WEB-INF/lib/b.jar",
"WEB-INF/lib/c.jar"
Expand All @@ -344,9 +344,9 @@ public void testOverlaysIncludesExcludesWithMultipleDefinitions() throws Excepti
assertOverlayedFile(webAppDirectory, "overlay-full-1", "jsp/d/c.jsp");
assertDefaultFileContent(testId, webAppDirectory, "org/sample/company/test.jsp");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/web.xml");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/a.class");
assertOverlayedFile(webAppDirectory, "overlay-full-3", "WEB-INF/classes/b.class");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/c.class");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/a.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-3", "WEB-INF/classes/b.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/c.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/lib/a.jar");
assertOverlayedFile(webAppDirectory, "overlay-full-3", "WEB-INF/lib/b.jar");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/lib/c.jar");
Expand Down Expand Up @@ -406,9 +406,9 @@ public void testOverlaysIncludesExcludesWithMultipleDefinitions2() throws Except
"jsp/d/b.jsp",
"jsp/d/c.jsp",
"org/sample/company/test.jsp",
"WEB-INF/classes/a.class",
"WEB-INF/classes/b.class",
"WEB-INF/classes/c.class",
"WEB-INF/classes/a.clazz",
"WEB-INF/classes/b.clazz",
"WEB-INF/classes/c.clazz",
"WEB-INF/lib/a.jar",
"WEB-INF/lib/b.jar",
"WEB-INF/lib/c.jar"
Expand All @@ -423,9 +423,9 @@ public void testOverlaysIncludesExcludesWithMultipleDefinitions2() throws Except
assertOverlayedFile(webAppDirectory, "overlay-full-1", "jsp/d/c.jsp");
assertDefaultFileContent(testId, webAppDirectory, "org/sample/company/test.jsp");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/web.xml");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/a.class");
assertOverlayedFile(webAppDirectory, "overlay-full-3", "WEB-INF/classes/b.class");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/c.class");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/a.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-3", "WEB-INF/classes/b.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/classes/c.clazz");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/lib/a.jar");
assertOverlayedFile(webAppDirectory, "overlay-full-3", "WEB-INF/lib/b.jar");
assertOverlayedFile(webAppDirectory, "overlay-full-2", "WEB-INF/lib/c.jar");
Expand Down

0 comments on commit ae901c9

Please sign in to comment.