Skip to content
Browse files

Deprecating AbstractBuild.getTestResultAction.

  • Loading branch information...
1 parent 66b076c commit 35b233976cd633cf0971a04c61f415f276c5fefc @jglick jglick committed Jul 22, 2014
View
5 src/test/java/hudson/plugins/testng/TestNGProjectActionTest.java
@@ -8,6 +8,7 @@
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.plugins.testng.util.TestResultHistoryUtil;
+import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.TestResult;
import junit.framework.Assert;
import org.junit.Test;
@@ -56,9 +57,9 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
FreeStyleBuild build = p.scheduleBuild2(0).get();
//assert of test result
- Assert.assertNotNull(build.getTestResultAction());
+ Assert.assertNotNull(build.getAction(AbstractTestResultAction.class));
TestResult testResult;
- Assert.assertNotNull(testResult = (TestResult) build.getTestResultAction().getResult());
+ Assert.assertNotNull(testResult = (TestResult) build.getAction(AbstractTestResultAction.class).getResult());
Assert.assertTrue(testResult.getTotalCount() > 0);
//assert on project action
View
5 src/test/java/hudson/plugins/testng/TestNGTestResultBuildActionTest.java
@@ -18,6 +18,7 @@
import hudson.plugins.testng.results.MethodResult;
import hudson.plugins.testng.results.PackageResult;
import hudson.plugins.testng.results.TestNGResult;
+import hudson.tasks.test.AbstractTestResultAction;
import junit.framework.Assert;
import org.junit.Test;
import org.jvnet.hudson.test.HudsonTestCase;
@@ -54,7 +55,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
//run build
FreeStyleBuild build = p.scheduleBuild2(0).get();
- TestNGResult testngResult = (TestNGResult) build.getTestResultAction().getResult();
+ TestNGResult testngResult = (TestNGResult) build.getAction(AbstractTestResultAction.class).getResult();
//Get page
HtmlPage page = createWebClient().goTo(build.getUrl() + PluginImpl.URL);
@@ -150,7 +151,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
//run build
FreeStyleBuild build = p.scheduleBuild2(0).get();
- TestNGResult testngResult = (TestNGResult) build.getTestResultAction().getResult();
+ TestNGResult testngResult = (TestNGResult) build.getAction(AbstractTestResultAction.class).getResult();
//Get page
HtmlPage page = createWebClient().goTo(build.getUrl() + PluginImpl.URL);
View
5 src/test/java/hudson/plugins/testng/results/ClassResultTest.java
@@ -20,6 +20,7 @@
import hudson.plugins.testng.PluginImpl;
import hudson.plugins.testng.Publisher;
import hudson.plugins.testng.PublisherCtor;
+import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.TestResult;
import org.junit.Test;
import org.jvnet.hudson.test.HudsonTestCase;
@@ -66,7 +67,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
//run build
FreeStyleBuild build = p.scheduleBuild2(0).get();
- TestNGResult testngResult = (TestNGResult) build.getTestResultAction().getResult();
+ TestNGResult testngResult = (TestNGResult) build.getAction(AbstractTestResultAction.class).getResult();
TestResult classResult = testngResult.findCorrespondingResult(PluginImpl.URL + "/precheckins/LegacyOps");
Map<String, GroupedTestRun> testRunMap = ((ClassResult)classResult).getTestRunMap();
@@ -168,7 +169,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
//run build
FreeStyleBuild build = p.scheduleBuild2(0).get();
- TestNGResult testngResult = (TestNGResult) build.getTestResultAction().getResult();
+ TestNGResult testngResult = (TestNGResult) build.getAction(AbstractTestResultAction.class).getResult();
TestResult classResult = testngResult.findCorrespondingResult(PluginImpl.URL + "/test/CommandLineTest");
Map<String, GroupedTestRun> testRunMap = ((ClassResult)classResult).getTestRunMap();
View
3 src/test/java/hudson/plugins/testng/results/MethodResultTest.java
@@ -15,6 +15,7 @@
import hudson.plugins.testng.PluginImpl;
import hudson.plugins.testng.Publisher;
import hudson.plugins.testng.PublisherCtor;
+import hudson.tasks.test.AbstractTestResultAction;
import hudson.tasks.test.TestResult;
import junit.framework.Assert;
import org.junit.Test;
@@ -241,7 +242,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
//run build
FreeStyleBuild build = p.scheduleBuild2(0).get();
- TestNGResult testngResult = (TestNGResult) build.getTestResultAction().getResult();
+ TestNGResult testngResult = (TestNGResult) build.getAction(AbstractTestResultAction.class).getResult();
TestResult methodResult = testngResult.findCorrespondingResult(
PluginImpl.URL + "/test/Test1/includedGroups_1");
View
3 src/test/java/hudson/plugins/testng/results/PackageResultTest.java
@@ -17,6 +17,7 @@
import hudson.plugins.testng.PluginImpl;
import hudson.plugins.testng.Publisher;
import hudson.plugins.testng.PublisherCtor;
+import hudson.tasks.test.AbstractTestResultAction;
import org.junit.Test;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.TestBuilder;
@@ -61,7 +62,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
//run build
FreeStyleBuild build = p.scheduleBuild2(0).get();
- TestNGResult testngResult = (TestNGResult) build.getTestResultAction().getResult();
+ TestNGResult testngResult = (TestNGResult) build.getAction(AbstractTestResultAction.class).getResult();
PackageResult pkgResult = (PackageResult) testngResult.findCorrespondingResult(PluginImpl.URL + "/precheckins");
//Get page

0 comments on commit 35b2339

Please sign in to comment.
Something went wrong with that request. Please try again.