Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for build with updated bundle versions #3899

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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
Loading