-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration test for Maven reactor make behaviours
- Loading branch information
1 parent
38cc0bd
commit f721332
Showing
14 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
tycho-its/projects/reactor.makeBehaviour/bundle1/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Bundle 1 | ||
Bundle-SymbolicName: bundle1;singleton:=true | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: J2SE-1.5 |
4 changes: 4 additions & 0 deletions
4
tycho-its/projects/reactor.makeBehaviour/bundle1/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<version>1.0.0-SNAPSHOT</version> | ||
<artifactId>bundle1</artifactId> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
<parent> | ||
<groupId>tycho-its-project.reactor.makeBehaviour</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
</project> |
7 changes: 7 additions & 0 deletions
7
tycho-its/projects/reactor.makeBehaviour/bundle2/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Bundle 2 | ||
Bundle-SymbolicName: bundle2;singleton:=true | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: J2SE-1.5 | ||
Require-Bundle: bundle1 |
4 changes: 4 additions & 0 deletions
4
tycho-its/projects/reactor.makeBehaviour/bundle2/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<version>1.0.0-SNAPSHOT</version> | ||
<artifactId>bundle2</artifactId> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
<parent> | ||
<groupId>tycho-its-project.reactor.makeBehaviour</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
</project> |
1 change: 1 addition & 0 deletions
1
tycho-its/projects/reactor.makeBehaviour/feature1/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin.includes=feature.xml |
13 changes: 13 additions & 0 deletions
13
tycho-its/projects/reactor.makeBehaviour/feature1/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<feature | ||
id="feature1" | ||
version="1.0.0.qualifier"> | ||
|
||
<plugin | ||
id="bundle1" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>tycho-its-project.reactor.makeBehaviour</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>feature1</artifactId> | ||
<packaging>eclipse-feature</packaging> | ||
</project> |
1 change: 1 addition & 0 deletions
1
tycho-its/projects/reactor.makeBehaviour/feature2/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin.includes=feature.xml |
17 changes: 17 additions & 0 deletions
17
tycho-its/projects/reactor.makeBehaviour/feature2/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<feature | ||
id="feature2" | ||
version="1.0.0.qualifier"> | ||
|
||
<includes | ||
id="feature1" | ||
version="0.0.0"/> | ||
|
||
<plugin | ||
id="bundle2" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>tycho-its-project.reactor.makeBehaviour</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>feature2</artifactId> | ||
<packaging>eclipse-feature</packaging> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>tycho-its-project.reactor.makeBehaviour</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>feature1</module> | ||
<module>feature2</module> | ||
<module>bundle1</module> | ||
<module>bundle2</module> | ||
</modules> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-maven-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<extensions>true</extensions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
105 changes: 105 additions & 0 deletions
105
...c/test/java/org/eclipse/tycho/test/reactor/makeBehaviour/MavenReactorMakeOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package org.eclipse.tycho.test.reactor.makeBehaviour; | ||
|
||
import static org.junit.Assert.fail; | ||
|
||
import org.apache.maven.it.VerificationException; | ||
import org.apache.maven.it.Verifier; | ||
import org.eclipse.tycho.test.AbstractTychoIntegrationTest; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test Maven reactor make behaviours | ||
* | ||
* Test project dependencies: | ||
* | ||
* <pre> | ||
* feature2 -> feature1,bundle2 | ||
* feature1 -> bundle1 | ||
* </pre> | ||
* | ||
*/ | ||
public class MavenReactorMakeOptionsTest extends AbstractTychoIntegrationTest { | ||
|
||
private Verifier verifier; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
verifier = getVerifier("reactor.makeBehaviour"); | ||
verifier.executeGoal("clean"); | ||
} | ||
|
||
@Test | ||
public void testCompleteBuild() throws Exception { | ||
verifier.executeGoal("verify"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar"); | ||
} | ||
|
||
@Test | ||
public void testAlsoMake() throws Exception { | ||
// REACTOR_MAKE_UPSTREAM | ||
verifier.addCliOption("-am"); | ||
verifier.addCliOption("-pl feature1"); | ||
verifier.executeGoal("verify"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar"); | ||
} | ||
|
||
@Test | ||
public void testAlsoMakeDependents() throws Exception { | ||
// REACTOR_MAKE_DOWNSTREAM | ||
verifier.addCliOption("-amd"); | ||
verifier.addCliOption("-pl bundle1,bundle2"); | ||
verifier.executeGoal("verify"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar"); | ||
} | ||
|
||
@Test | ||
public void testBoth() throws Exception { | ||
// REACTOR_MAKE_BOTH | ||
verifier.addCliOption("-am"); | ||
verifier.addCliOption("-amd"); | ||
verifier.addCliOption("-pl feature1,bundle2"); | ||
verifier.executeGoal("verify"); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar"); | ||
verifier.assertFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar"); | ||
} | ||
|
||
@Test | ||
public void testSingleProjectNoOptionFails() throws Exception { | ||
try { | ||
verifier.addCliOption("-pl feature1"); | ||
verifier.executeGoal("verify"); | ||
fail("Build should fail due to missing reactor dependency"); | ||
} catch (VerificationException e) { | ||
verifier.verifyTextInLog("TODO complete"); | ||
} | ||
} | ||
|
||
@Test | ||
public void testDownstreamFailsIfMissingDownstreamDependency() throws Exception { | ||
// Downstream brings in feature2 but this requires bundle2 which is unrelated | ||
// to specified projects | ||
try { | ||
verifier.addCliOption("-amd"); | ||
verifier.addCliOption("-pl bundle1,feature1"); | ||
verifier.executeGoal("verify"); | ||
fail("Build should fail due to missing reactor dependency"); | ||
} catch (VerificationException e) { | ||
verifier.verifyTextInLog("TODO complete"); | ||
} | ||
} | ||
|
||
} |