Skip to content

Commit

Permalink
moxy.asm.version vs asm.version release test
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
  • Loading branch information
senivam committed Nov 5, 2024
1 parent e50a049 commit 47c0908
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@
<jsonp.ri.version>1.1.7</jsonp.ri.version>
<jsonp.jaxrs.version>1.1.7</jsonp.jaxrs.version>
<moxy.version>5.0.0-B02</moxy.version>
<moxy.asm.version>9.7.0</moxy.asm.version> <!-- TODO: update and remove @Ignore from the MoxyAsmTest -->
<moxy.asm.version>9.7.1</moxy.asm.version>
<yasson.version>3.0.4</yasson.version>
<!-- END of Jakartified -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

public class MoxyAsmTest {
@Test
@Ignore("Until moxy.asm 9.7.1 is released")
public void testAsmInMoxy() throws Exception {
String moxyPomFile = "../../media/moxy/pom.xml";
Model moxyPom = MavenUtil.getModelFromFile(moxyPomFile);
Expand All @@ -33,21 +32,11 @@ public void testAsmInMoxy() throws Exception {
.findFirst().get();
Model projectPom = MavenUtil.getModelFromFile("../../pom.xml");
final String asmVersion = projectPom.getProperties().getProperty("asm.version");
final String moxyAsmVersion = findVersionInModel(moxyAsmDependency.getVersion(), projectPom);
final String moxyAsmVersion = projectPom.getProperties().getProperty("moxy.asm.version");

final String lastTwo = moxyAsmVersion.substring(moxyAsmVersion.length() - 2);
final String msg = "org.eclipse.persistence.asm version " + moxyAsmVersion
+ " differs from asm version " + asmVersion + " in /media/moxy/pom.xml";
Assert.assertEquals(msg, asmVersion + lastTwo, moxyAsmVersion);
final String msg = "org.eclipse.persistence.asm (moxy.asm.version) version " + moxyAsmVersion
+ " differs from asm version (asm.version) " + asmVersion + " in /media/moxy/pom.xml";
Assert.assertEquals(msg, asmVersion, moxyAsmVersion);
System.out.println("Found expected Moxy ASM version " + moxyAsmVersion);
}

private static String findVersionInModel(String version, Model model) {
if (version.startsWith("${")) {
String _version = version.substring(2, version.length() - 1);
return model.getProperties().getProperty(_version);
} else {
return version;
}
}
}

0 comments on commit 47c0908

Please sign in to comment.