Skip to content

Commit

Permalink
Add a testcase for issue eclipse-tycho#406
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Läubrich <[email protected]>
  • Loading branch information
laeubi committed Apr 13, 2022
1 parent a2348c4 commit 5111ee3
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
classpath=true
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
10 changes: 10 additions & 0 deletions tycho-its/projects/tycho-ds/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Tycho DS
Bundle-SymbolicName: tycho.ds
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: tycho.ds
Bundle-RequiredExecutionEnvironment: JavaSE-11
Service-Component: OSGI-INF/tycho.ds.TestComponent.xml
Bundle-ActivationPolicy: lazy
Import-Package: org.osgi.framework
5 changes: 5 additions & 0 deletions tycho-its/projects/tycho-ds/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/tycho.ds.TestComponent.xml
30 changes: 30 additions & 0 deletions tycho-its/projects/tycho-ds/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.tycho.its</groupId>
<artifactId>tycho.ds</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<tycho-version>3.0.0-SNAPSHOT</tycho-version>
<repo-url>https://download.eclipse.org/releases/2022-03/</repo-url>
</properties>

<repositories>
<repository>
<id>featureRepo</id>
<layout>p2</layout>
<url>${repo-url}</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
19 changes: 19 additions & 0 deletions tycho-its/projects/tycho-ds/src/tycho/ds/TestComponent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package tycho.ds;

import org.osgi.framework.BundleContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

@Component
public class TestComponent {

@Reference
private Runnable service;

@Activate
public void activate(BundleContext bundleContext) {

}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021 Christoph Läubrich and others.
* Copyright (c) 2021, 2022 Christoph Läubrich and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -14,27 +14,39 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.EnvironmentUtil;
import org.junit.Test;

public class CompilerClasspathEntryTest extends AbstractTychoIntegrationTest {

@Test
public void testJUnit4Container() throws Exception {
Verifier verifier = getVerifier("compiler.junitcontainer/junit4-in-bundle", true);
verifier.executeGoal("test");
verifier.verifyErrorFreeLog();
}
@Test
public void testJUnit4Container() throws Exception {
Verifier verifier = getVerifier("compiler.junitcontainer/junit4-in-bundle", true);
verifier.executeGoal("test");
verifier.verifyErrorFreeLog();
}

@Test
public void testJUnit4ContainerWithDependencies() throws Exception {
Verifier verifier = getVerifier("compiler.junitcontainer/junit4-in-bundle-with-dependencies", true);
verifier.executeGoal("test");
verifier.verifyErrorFreeLog();
}

@Test
public void testLibEntry() throws Exception {
Verifier verifier = getVerifier("compiler.libentry/my.bundle", false);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}

@Test
public void testDSComponents() throws Exception {
Verifier verifier = getVerifier("tycho-ds", false, true);
verifier.setSystemProperty("repo-url", EnvironmentUtil.ECLIPSE_LATEST);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
// TODO verify component xml?
}

@Test
public void testJUnit4ContainerWithDependencies() throws Exception {
Verifier verifier = getVerifier("compiler.junitcontainer/junit4-in-bundle-with-dependencies", true);
verifier.executeGoal("test");
verifier.verifyErrorFreeLog();
}

public void testLibEntry() throws Exception {
Verifier verifier = getVerifier("compiler.libentry/my.bundle", false);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}
}

0 comments on commit 5111ee3

Please sign in to comment.