Skip to content

Commit 75b9406

Browse files
committed
GROOVY-10093
1 parent 50e0e97 commit 75b9406

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
lines changed

base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/builder/BasicGroovyBuildTests.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,18 @@ private IPath[] createSimpleProject(final String name, final boolean isGroovy) t
9898
}
9999

100100
private void addJUnitAndSpock(final IPath projectPath) throws Exception {
101-
int jUnitVersion = 4;
102101
String spockCorePath;
103-
if (isAtLeastGroovy(30)) {
104-
jUnitVersion = 5;
105-
spockCorePath = "lib/spock-core-2.0-M4-groovy-3.0.jar";
102+
if (!isAtLeastGroovy(30)) {
103+
spockCorePath = "lib/spock-core-2.0-groovy-2.5.jar";
104+
env.addJar(projectPath, "lib/spock-groovy2-compat-2.0.jar");
105+
} else {
106+
spockCorePath = "lib/spock-core-2.0-groovy-3.0.jar";
106107
if (isAtLeastGroovy(40)) {
107108
System.setProperty("spock.iKnowWhatImDoing.disableGroovyVersionCheck", "true");
108109
}
109-
} else {
110-
spockCorePath = "lib/spock-core-1.3-groovy-2.5.jar";
111110
}
112111
env.addJar(projectPath, spockCorePath);
113-
114-
env.addEntry(projectPath, JavaCore.newContainerEntry(
115-
new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/" + jUnitVersion)));
112+
env.addEntry(projectPath, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/5")));
116113
}
117114

118115
// check whether these are identical (in everything except name!)

base-test/org.eclipse.jdt.groovy.core.tests.builder/src/org/eclipse/jdt/core/groovy/tests/search/SpockInferencingTests.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2020 the original author or authors.
2+
* Copyright 2009-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,12 +29,13 @@ public final class SpockInferencingTests extends InferencingTestSuite {
2929
public void setUp() throws Exception {
3030
String spockCorePath;
3131
if (isAtLeastGroovy(30)) {
32-
spockCorePath = "lib/spock-core-2.0-M4-groovy-3.0.jar";
32+
spockCorePath = "lib/spock-core-2.0-groovy-3.0.jar";
3333
} else {
34-
spockCorePath = "lib/spock-core-1.3-groovy-2.5.jar";
34+
spockCorePath = "lib/spock-core-2.0-groovy-2.5.jar";
35+
env.addJar(project.getFullPath(), "lib/spock-groovy2-compat-2.0.jar");
3536
}
3637
env.addJar(project.getFullPath(), spockCorePath);
37-
env.addEntry(project.getFullPath(), JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/4")));
38+
env.addEntry(project.getFullPath(), JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/5")));
3839
}
3940

4041
@Test
@@ -129,7 +130,7 @@ public void testPropertyCheck() {
129130
assertType(source, offset, offset + 3, "java.lang.Integer");
130131
}
131132

132-
@Test @Ignore("see #814") // https://github.com/groovy/groovy-eclipse/issues/812
133+
@Test @Ignore("see #814") // https://github.com/groovy/groovy-eclipse/issues/814
133134
public void testDataTableChecks() {
134135
//@formatter:off
135136
String source =

extras/groovy-eclipse-compiler-tests/src/it/groovy-for-tests/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>org.spockframework</groupId>
3434
<artifactId>spock-core</artifactId>
35-
<version>2.0-M4-groovy-3.0</version>
35+
<version>2.0-groovy-3.0</version>
3636
<scope>test</scope>
3737
<exclusions>
3838
<exclusion>

ide-test/org.codehaus.groovy.eclipse.refactoring.test/resources/Formatter/Formatter_Test_List_spock_expect

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@
22
setPreferences=true
33
indentendOnly=false
44
###src
5-
class Issue1219 extends spock.lang.Specification {
6-
void 'test'() {
5+
class SpockTests extends spock.lang.Specification {
6+
void "issue 1219"() {
77
expect:
88
[] == []
99
toString()
1010
}
11+
void "issue 1258"() {
12+
expect:
13+
[] == []
14+
}
1115
}
1216
###exp
13-
class Issue1219 extends spock.lang.Specification {
14-
void 'test'() {
17+
class SpockTests extends spock.lang.Specification {
18+
void "issue 1219"() {
1519
expect:
1620
[] == []
1721
toString()
1822
}
23+
void "issue 1258"() {
24+
expect:
25+
[] == []
26+
}
1927
}
2028
###end

0 commit comments

Comments
 (0)