Skip to content

Commit 1ad7abb

Browse files
authored
Merge pull request #296 from bitwiseman/patch-2
Remove gmaven and groovy test
2 parents a24c411 + 5463571 commit 1ad7abb

File tree

3 files changed

+47
-94
lines changed

3 files changed

+47
-94
lines changed

pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,6 @@
289289
</resource>
290290
</resources>
291291
<plugins>
292-
<plugin>
293-
<!-- why is this necessary!? otherwise compiling src/test/groovy/ fails -->
294-
<!-- fix attempted at https://github.com/jenkinsci/jenkins/commit/101507f49873de0239ccb7839649ea71187712b2 but apparently failed. -->
295-
<groupId>org.codehaus.gmaven</groupId>
296-
<artifactId>gmaven-plugin</artifactId>
297-
<configuration>
298-
<providerSelection>1.8</providerSelection>
299-
</configuration>
300-
</plugin>
301292
<plugin>
302293
<groupId>org.jenkins-ci.tools</groupId>
303294
<artifactId>maven-hpi-plugin</artifactId>

src/test/groovy/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinitionTest.groovy

Lines changed: 0 additions & 85 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package org.jenkinsci.plugins.workflow.cps;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.assertTrue;
6+
import static org.junit.Assert.assertEquals;
7+
8+
/**
9+
* @author Kohsuke Kawaguchi
10+
*/
11+
public class CpsFlowDefinitionTest extends AbstractCpsFlowTest {
12+
/**
13+
* CpsFlowDefinition's simplest possible test.
14+
*/
15+
@Test
16+
public void simplestPossibleTest() throws Exception {
17+
CpsFlowDefinition flow = new CpsFlowDefinition(
18+
"def sqrt(int x) { return Math.sqrt(x); }\n" +
19+
"for (int i=0; i<10; i++) { sqrt(i); }",
20+
false);
21+
22+
createExecution(flow);
23+
exec.start();
24+
exec.waitForSuspension();
25+
26+
assertTrue(exec.isComplete());
27+
}
28+
29+
@Test
30+
public void exceptionInWorkflowShouldBreakFlowExecution() throws Exception {
31+
CpsFlowDefinition flow = new CpsFlowDefinition(
32+
"throw new Throwable('This is a fire drill, not a real fire');",
33+
false);
34+
35+
// get this going...
36+
createExecution(flow);
37+
exec.start();
38+
39+
// it should stop at watch and suspend.
40+
exec.waitForSuspension();
41+
assertTrue(exec.isComplete());
42+
Throwable t = exec.getCauseOfFailure();
43+
assertEquals(Throwable.class, t.getClass());
44+
assertEquals("This is a fire drill, not a real fire", t.getMessage());
45+
}
46+
47+
}

0 commit comments

Comments
 (0)