提交 65c0a2c7 编写于 作者: B Baptiste Mathus

Fix generics ambiguity

Inline the method to use concrete subtypes of AbstractBuild to remove ambiguity

```
[INFO] Jenkins war ........................................ SUCCESS [04:19 min]
[INFO] Tests for Jenkins core ............................. FAILURE [ 18.740 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:01 min
[INFO] Finished at: 2017-03-29T23:07:16+02:00
[INFO] Final Memory: 92M/504M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:testCompile (default-testCompile) on project test: Compilation failure
[ERROR] /home/tiste/dev/JENKINS/jenkins/test/src/test/java/hudson/model/GetEnvironmentOutsideBuildTest.java:[89,30] error: no suitable method found for buildAndAssertSuccess(AbstractProject)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :test
```
上级 77dfa64b
......@@ -6,8 +6,10 @@ import static org.junit.Assert.assertNull;
import java.io.IOException;
import hudson.EnvVars;
import hudson.matrix.MatrixBuild;
import hudson.matrix.MatrixProject;
import hudson.maven.MavenModuleSet;
import hudson.maven.MavenModuleSetBuild;
import hudson.tasks.Maven.MavenInstallation;
import hudson.util.StreamTaskListener;
......@@ -69,24 +71,23 @@ public class GetEnvironmentOutsideBuildTest extends HudsonTestCase {
public void testMaven() throws Exception {
MavenModuleSet m = createSimpleMavenProject();
assertGetEnvironmentCallOutsideBuildWorks(m);
final MavenModuleSetBuild build = buildAndAssertSuccess(m);
assertGetEnvironmentWorks(build);
}
public void testFreestyle() throws Exception {
FreeStyleProject project = createFreeStyleProject();
assertGetEnvironmentCallOutsideBuildWorks(project);
final FreeStyleBuild build = buildAndAssertSuccess(project);
assertGetEnvironmentWorks(build);
}
public void testMatrix() throws Exception {
MatrixProject createMatrixProject = jenkins.createProject(MatrixProject.class, "mp");
assertGetEnvironmentCallOutsideBuildWorks(createMatrixProject);
}
@SuppressWarnings({"rawtypes", "unchecked"})
private void assertGetEnvironmentCallOutsideBuildWorks(AbstractProject job) throws Exception {
AbstractBuild build = buildAndAssertSuccess(job);
final MatrixBuild build = buildAndAssertSuccess(createMatrixProject);
assertGetEnvironmentWorks(build);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册