Skip to content

Commit

Permalink
Minimal test for issue 230
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-faust committed Mar 27, 2022
1 parent d5e199f commit 75b5cdb
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tycho-its-project.compiler.mavenCompilerPlugin.moduleWithTests</groupId>
<artifactId>c.m.m</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.release>11</maven.compiler.release>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<compilerId>jdt</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
<version>${tycho-version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package ex;
public class A {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module ex {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package ex;
class ATest {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,37 @@

public class MavenCompilerPluginTest extends AbstractTychoIntegrationTest {

@Test
public void testJDTCompilerId() throws Exception {
Verifier verifier = getVerifier("compiler.mavenCompilerPlugin", false);
try {
verifier.executeGoal("compile");
Assert.fail();
} catch (VerificationException e) {
// expected
verifier.verifyTextInLog("field Foo.unused is not used");
}
}

@Test
public void testAdditionalBundles() throws Exception {
Verifier verifier = getVerifier("compiler.additional.bundles", true);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}

@Test
public void testLimitModules() throws Exception {
Verifier verifier = getVerifier("compiler.limit.modules", true);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}
@Test
public void testJDTCompilerId() throws Exception {
Verifier verifier = getVerifier("compiler.mavenCompilerPlugin", false);
try {
verifier.executeGoal("compile");
Assert.fail();
} catch (VerificationException e) {
// expected
verifier.verifyTextInLog("field Foo.unused is not used");
}
}

@Test
public void testMavenCompilerPluginModuleWithTests() throws Exception {
Verifier verifier = getVerifier("compiler.mavenCompilerPlugin.moduleWithTests", false);
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();
}

@Test
public void testAdditionalBundles() throws Exception {
Verifier verifier = getVerifier("compiler.additional.bundles", true);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}

@Test
public void testLimitModules() throws Exception {
Verifier verifier = getVerifier("compiler.limit.modules", true);
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}

}

0 comments on commit 75b5cdb

Please sign in to comment.