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

Fix/test with gradle #21

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ task generatePluginDescriptor(type: JavaExec, dependsOn: compileJava) {
appendNode('directory', directory)
appendNode('outputDirectory', outputDirectory)
}
asNode().appendNode('version', paramVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dustinbyrne what's fixed by doing this?

}
.writeTo(pomFile)

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/appland/appmap/GoalLoadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ public class GoalLoadTest extends AbstractMojoTestCase {

@Test
public void testPrepareAgentGoalIsLoadedCorrectly() throws Exception {
File pluginPom = new File("target/test-classes/test-project2/pom.xml");
File pluginPom = new File("build/resources/test/test-project2/pom.xml");
LoadJavaAppMapAgentMojo mojo = (LoadJavaAppMapAgentMojo) lookupMojo("prepare-agent", pluginPom);
assertNotNull(mojo);
}

@Test
public void testValidateConfigGoalIsLoadedCorrectly() throws Exception {
File pluginPom = new File("target/test-classes/test-project2/pom.xml");
File pluginPom = new File("build/resources/test/test-project2/pom.xml");
ValidateConfigMojo mojo = (ValidateConfigMojo) lookupMojo("validate-config", pluginPom);
assertNotNull(mojo);
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/appland/appmap/PluginLoadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void testMojoCanBeInstantiated()
Mojo mojo = rule.configureMojo(
new LoadJavaAppMapAgentMojo(),
"appmap-maven-plugin",
new File("target/test-classes/test-project/pom.xml")
new File("build/resources/test/test-project/pom.xml")
);
assertNotNull(mojo);
}
Expand All @@ -42,7 +42,7 @@ public void testMojoIsLoaded() throws Exception {
rule.configureMojo(
new LoadJavaAppMapAgentMojo(),
"appmap-maven-plugin",
new File("target/test-classes/test-project/pom.xml")
new File("build/resources/test/test-project/pom.xml")
);
assertNotNull(mojo);
}
Expand All @@ -53,12 +53,12 @@ public void testMojoFailsWithMissingDefaultConfigFile() throws Exception {
rule.configureMojo(
new LoadJavaAppMapAgentMojo(),
"appmap-maven-plugin",
new File("target/test-classes/test-project/pom.xml")
new File("build/resources/test/test-project/pom.xml")
);
assertNotNull(mojo);
Exception exception = assertThrows(
MojoExecutionException.class,
() -> rule.executeMojo(new File("target/test-classes/test-project/"), "prepare-agent")
() -> rule.executeMojo(new File("build/resources/test/test-project/"), "prepare-agent")
);
assertTrue(exception.getCause() instanceof FileNotFoundException);
}
Expand All @@ -69,12 +69,12 @@ public void testMojoFailsWithNotExistingConfigFile() throws Exception {
rule.configureMojo(
new LoadJavaAppMapAgentMojo(),
"appmap-maven-plugin",
new File("target/test-classes/test-project/nonexistent_config_file_pom.xml")
new File("build/resources/test/test-project/nonexistent_config_file_pom.xml")
);
assertNotNull(mojo);
Exception exception = assertThrows(
MojoExecutionException.class,
() -> rule.executeMojo(new File("target/test-classes/test-project/"), "prepare-agent")
() -> rule.executeMojo(new File("build/resources/test/test-project/"), "prepare-agent")
);
assertTrue(exception.getCause() instanceof FileNotFoundException);
}
Expand Down