Skip to content

Commit

Permalink
Add test for build with updated bundle versions
Browse files Browse the repository at this point in the history
  • Loading branch information
fipro78 committed Jun 7, 2024
1 parent 13489c6 commit ccb3325
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tycho-its/src/test/java/org/eclipse/tycho/test/DemoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@ public void testAutomaticManifest() throws Exception {
.anyMatch(pkg -> "tycho.demo.service.api".equals(pkg.getName())));
}

@Test
public void testAutomaticManifestUpdateVersion() throws Exception {
// run the initial build
Verifier verifier = runDemo("pde-automatic-manifest");

// now update the version
verifier.executeGoals(
List.of("org.eclipse.tycho:tycho-versions-plugin:set-version", "-DnewVersion=1.1.0.qualifier"));
verifier.verifyErrorFreeLog();

// build again
verifier.executeGoals(List.of("clean", "verify"));
verifier.verifyErrorFreeLog();

BundleDescription description = BundlesAction.createBundleDescription(Path
.of(verifier.getBasedir(), "tycho.demo.service.impl/target/tycho.demo.service.impl-1.1.0-SNAPSHOT.jar")
.toFile());
assertNotNull("demo bundle was not packed", description);
@SuppressWarnings("unchecked")
Dictionary<String, String> manifest = (Dictionary<String, String>) description.getUserObject();
assertEquals("Service component not found", "OSGI-INF/tycho.demo.service.impl.InverterServiceImpl.xml",
manifest.get("Service-Component"));
assertTrue("tycho.demo.service.api package not imported", Arrays.stream(description.getImportPackages())
.anyMatch(pkg -> "tycho.demo.service.api".equals(pkg.getName())));
}

@Test
public void testTychoJustJDemo() throws Exception {
assertIncludesJustJ(new File(runDemo("justj", "-f", "product").getBasedir(),
Expand Down

0 comments on commit ccb3325

Please sign in to comment.