Skip to content

Commit ba13afb

Browse files
committed
Remove groovy test entirely
1 parent c2f1b2d commit ba13afb

File tree

3 files changed

+43
-115
lines changed

3 files changed

+43
-115
lines changed

pom.xml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -289,36 +289,6 @@
289289
</resource>
290290
</resources>
291291
<plugins>
292-
<!-- gmaven is inherited from the parent-pom. Set it to never run. -->
293-
<plugin>
294-
<groupId>org.codehaus.gmaven</groupId>
295-
<artifactId>gmaven-plugin</artifactId>
296-
<executions>
297-
<execution>
298-
<phase>none</phase>
299-
</execution>
300-
<execution>
301-
<id>test-in-groovy</id>
302-
<phase>none</phase>
303-
</execution>
304-
</executions>
305-
</plugin>
306-
<plugin>
307-
<groupId>org.codehaus.gmavenplus</groupId>
308-
<artifactId>gmavenplus-plugin</artifactId>
309-
<version>1.7.1</version>
310-
<executions>
311-
<execution>
312-
<goals>
313-
<goal>generateTestStubs</goal>
314-
<goal>compileTests</goal>
315-
</goals>
316-
</execution>
317-
</executions>
318-
<configuration>
319-
<testStubsOutputDirectory>${project.build.directory}/generated-test-sources/groovy-stubs</testStubsOutputDirectory>
320-
</configuration>
321-
</plugin>
322292
<plugin>
323293
<groupId>org.jenkins-ci.tools</groupId>
324294
<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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package org.jenkinsci.plugins.workflow.cps;
2+
3+
import org.junit.Test;
4+
5+
/**
6+
* @author Kohsuke Kawaguchi
7+
*/
8+
public class CpsFlowDefinitionTest extends AbstractCpsFlowTest {
9+
/**
10+
* CpsFlowDefinition's simplest possible test.
11+
*/
12+
@Test
13+
public void simplestPossibleTest() throws Exception {
14+
CpsFlowDefinition flow = new CpsFlowDefinition(
15+
"def sqrt(int x) { return Math.sqrt(x); }\nfor (int i=0; i<10; i++)\nsqrt(i);",
16+
false);
17+
18+
createExecution(flow);
19+
exec.start();
20+
exec.waitForSuspension();
21+
22+
assert exec.isComplete();
23+
}
24+
25+
@Test
26+
public void exceptionInWorkflowShouldBreakFlowExecution() throws Exception {
27+
CpsFlowDefinition flow = new CpsFlowDefinition(
28+
"throw new Throwable('This is a fire drill, not a real fire');",
29+
false);
30+
31+
// get this going...
32+
createExecution(flow);
33+
exec.start();
34+
35+
// it should stop at watch and suspend.
36+
exec.waitForSuspension();
37+
assert exec.isComplete();
38+
Throwable t = exec.getCauseOfFailure();
39+
assert t.getClass().equals(Throwable.class);
40+
assert t.getMessage().equals("This is a fire drill, not a real fire");
41+
}
42+
43+
}

0 commit comments

Comments
 (0)