Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: cucumber/cucumber-jvm
...
head fork: cucumber/cucumber-jvm
  • 14 commits
  • 32 files changed
  • 0 commit comments
  • 2 contributors
Showing with 86 additions and 39 deletions.
  1. +9 −2 History.md
  2. +5 −5 README.md
  3. +1 −1  clojure/pom.xml
  4. +1 −0  clojure/src/main/clj/cucumber/runtime/clj.clj
  5. +1 −1  core/pom.xml
  6. +4 −0 core/src/main/java/cucumber/runtime/Utils.java
  7. +0 −1  core/src/test/java/cucumber/runtime/UtilsTest.java
  8. +1 −1  examples/groovy-calculator/pom.xml
  9. +1 −1  examples/java-calculator/pom.xml
  10. +1 −1  examples/java-helloworld/build.xml
  11. +20 −4 examples/java-helloworld/pom.xml
  12. +1 −1  examples/java-webbit-websockets-selenium/pom.xml
  13. +1 −1  examples/scala-calculator/pom.xml
  14. +1 −1  groovy/pom.xml
  15. 0  groovy/src/test/{groovy → java}/cucumber/runtime/groovy/GroovySnippetTest.java
  16. +1 −1  guice/pom.xml
  17. +1 −1  ioke/pom.xml
  18. +1 −1  java/pom.xml
  19. +6 −2 java/src/main/java/cucumber/runtime/java/ClasspathMethodScanner.java
  20. +10 −1 java/src/test/java/cucumber/runtime/java/JavaBackendTest.java
  21. +1 −1  jruby/pom.xml
  22. +1 −1  junit/pom.xml
  23. +9 −2 junit/src/main/java/cucumber/junit/RuntimeOptionsFactory.java
  24. +1 −1  jython/pom.xml
  25. +1 −1  openejb/pom.xml
  26. +1 −1  picocontainer/pom.xml
  27. +1 −1  pom.xml
  28. +1 −1  rhino/pom.xml
  29. +1 −1  scala/pom.xml
  30. +1 −1  scala/src/main/scala/cucumber/runtime/ScalaSnippet.scala
  31. +1 −1  spring/pom.xml
  32. +1 −1  weld/pom.xml
11 History.md
View
@@ -1,3 +1,10 @@
+## [1.0.2](https://github.com/cucumber/cucumber-jvm/compare/v1.0.1...v1.0.2)
+
+* [Java] Snippets using a table have a hint about how to use List<YourClass>. (Aslak Hellesøy)
+* [Java] Don't convert paths to package names - instead throw an exception. This helps people avoid mistakes. (Aslak Hellesøy)
+* [Scala] Fixed generated Scala snippets ([#282](https://github.com/cucumber/cucumber-jvm/pull/282) pawel-s)
+* [JUnit] Automatically turn off ANSI colours when launched from IDEA. (Aslak Hellesøy)
+
## [1.0.1](https://github.com/cucumber/cucumber-jvm/compare/v1.0.0...v1.0.1)
* [Clojure] Fix quoting of generated Clojure snippets ([#277](https://github.com/cucumber/cucumber-jvm/pull/277) Michael van Acken)
@@ -9,7 +16,7 @@
* [Docs] Added Cuke4Duke migration notes to README ([#239](https://github.com/cucumber/cucumber-jvm/pull/239) coldbloodedtx)
* [Core] Added --monochrome flag, allowing monochrome output for certain formatters ([#221](https://github.com/cucumber/cucumber-jvm/issues/221) Aslak Hellesøy)
* [Core] Added a usage formatter ([#207](https://github.com/cucumber/cucumber-jvm/issues/207), [#214](https://github.com/cucumber/cucumber-jvm/pull/214) Klaus Bayrhammer)
-* [Core] JavaScript-Error in HTML-Report when using ScenarioResult.write ((#254)[https://github.com/cucumber/cucumber-jvm/issues/254] Aslak Hellesøy)
+* [Core] JavaScript-Error in HTML-Report when using ScenarioResult.write ([#254](https://github.com/cucumber/cucumber-jvm/issues/254) Aslak Hellesøy)
* [Java] Add support for enums in stepdefs ([#217](https://github.com/cucumber/cucumber-jvm/issues/217), [#240](https://github.com/cucumber/cucumber-jvm/pull/240) Gilles Philippart)
* [Core] Help text for CLI. ([#142](https://github.com/cucumber/cucumber-jvm/issues/142) Aslak Hellesøy)
* [JUnit] Eclipse JUnit reports inaccurate run count ([#263](https://github.com/cucumber/cucumber-jvm/issues/263), [#274](https://github.com/cucumber/cucumber-jvm/pull/274) dgradl)
@@ -53,7 +60,7 @@
* [Core] Stacktrace filtering filters away too much. ([#228](https://github.com/cucumber/cucumber-jvm/issues/228) Aslak Hellesøy)
* [Groovy] Fix native Groovy cucumber CLI ([#212](https://github.com/cucumber/cucumber-jvm/issues/212) Martin Hauner)
* [Core] Indeterministic feature ordering on Unix ([#224](https://github.com/cucumber/cucumber-jvm/issues/224) hutchy2570)
-* [JUnit] New JUnitFormatter (--format junit) that outputs Ant-style JUnit XML. ([#226](https://github.com/cucumber/cucumber-jvm/pull/226), (#171)[https://github.com/cucumber/cucumber-jvm/issues/171] Vladimir Miguro)
+* [JUnit] New JUnitFormatter (--format junit) that outputs Ant-style JUnit XML. ([#226](https://github.com/cucumber/cucumber-jvm/pull/226), [#171](https://github.com/cucumber/cucumber-jvm/issues/171) Vladimir Miguro)
## [1.0.0.RC16](https://github.com/cucumber/cucumber-jvm/compare/v1.0.0.RC15...v1.0.0.RC16)
10 README.md
View
@@ -46,13 +46,13 @@ in your [POM](http://maven.apache.org/pom.html):
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -70,7 +70,7 @@ There are more jars available - add the ones you need. (TODO: A guide on how to
Add a [dependency](http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html) in your [ivy.xml](http://ant.apache.org/ivy/history/latest-milestone/ivyfile.html):
```xml
- <dependency org="info.cukes" name="cucumber-core" rev="1.0.1"/>
+ <dependency org="info.cukes" name="cucumber-core" rev="1.0.2"/>
```
Since the artifacts are released to Maven Central, the default Ivy configuration should pull them down automatically.
@@ -90,7 +90,7 @@ There isn't any online documentation yet. Check out the examples, read the code
### API Docs
-* http://cukes.info/cucumber/jvm/api/1.0.1
+* http://cukes.info/cucumber/jvm/api/1.0.2
## Examples
@@ -223,7 +223,7 @@ Then release everything:
```
mvn release:clean
-mvn --batch-mode -P release-sign-artifacts release:prepare -DautoVersionSubmodules=true -DdevelopmentVersion=1.0.2-SNAPSHOT
+mvn --batch-mode -P release-sign-artifacts release:prepare -DautoVersionSubmodules=true -DdevelopmentVersion=1.0.3-SNAPSHOT
mvn -P release-sign-artifacts release:perform
```
2  clojure/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-clojure</artifactId>
1  clojure/src/main/clj/cucumber/runtime/clj.clj
View
@@ -31,6 +31,7 @@
"," ""))
(namedGroupStart [_] nil)
(namedGroupEnd [_] nil)
+ (tableHint [_] nil)
(escapePattern [_ pattern]
(str/replace (str pattern) "\"" "\\\""))))
2  core/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-core</artifactId>
4 core/src/main/java/cucumber/runtime/Utils.java
View
@@ -36,6 +36,10 @@ public static String packagePath(String packageName) {
return packageName.replace('.', '/');
}
+ public static String packageName(Class clazz) {
+ return packageName(clazz.getName());
+ }
+
public static String packageName(String className) {
return className.substring(0, Math.max(0, className.lastIndexOf(".")));
}
1  core/src/test/java/cucumber/runtime/UtilsTest.java
View
@@ -19,7 +19,6 @@ public void finds_path_for_class_in_package() {
@Test
public void finds_path_for_class_in_toplevel_package() {
assertEquals("", packageName("TopLevelClass"));
- assertEquals("", packagePath(packageName("TopLevelClass")));
}
@Test
2  examples/groovy-calculator/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>groovy-calculator</artifactId>
2  examples/java-calculator/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>java-calculator</artifactId>
2  examples/java-helloworld/build.xml
View
@@ -1,6 +1,6 @@
<project name="java-helloworld" basedir="." default="runcukes">
<property name="repo" value="https://oss.sonatype.org/content/repositories/releases"/>
- <property name="cucumber-jvm.version" value="1.0.1"/>
+ <property name="cucumber-jvm.version" value="1.0.2"/>
<property name="gherkin.version" value="2.9.3"/>
<property name="junit.version" value="4.10"/>
<property name="jars" value="target/lib"/>
24 examples/java-helloworld/pom.xml
View
@@ -1,23 +1,39 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>info.cukes</groupId>
<artifactId>java-helloworld</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
<packaging>jar</packaging>
<name>Examples: Java Hello World</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
2  examples/java-webbit-websockets-selenium/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>java-webbit-websockets-selenium</artifactId>
2  examples/scala-calculator/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>scala-calculator</artifactId>
2  groovy/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-groovy</artifactId>
0  ...vy/cucumber/runtime/groovy/GroovySnippetTest.java → ...va/cucumber/runtime/groovy/GroovySnippetTest.java
View
File renamed without changes
2  guice/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-guice</artifactId>
2  ioke/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-ioke</artifactId>
2  java/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-java</artifactId>
8 java/src/main/java/cucumber/runtime/java/ClasspathMethodScanner.java
View
@@ -4,6 +4,7 @@
import cucumber.annotation.Before;
import cucumber.annotation.Order;
import cucumber.io.ClasspathResourceLoader;
+import cucumber.runtime.CucumberException;
import cucumber.runtime.Utils;
import java.lang.annotation.Annotation;
@@ -29,8 +30,11 @@ public ClasspathMethodScanner(ClasspathResourceLoader resourceLoader) {
*/
public void scan(JavaBackend javaBackend, List<String> gluePaths) {
for (String gluePath : gluePaths) {
- String packageName = gluePath.replace('/', '.').replace('\\', '.'); // Sometimes the gluePath will be a path, not a package
- for (Class<?> glueCodeClass : resourceLoader.getDescendants(Object.class, packageName)) {
+ if(gluePath.contains("/") || gluePath.contains("\\")) {
+ throw new CucumberException("Java glue must be a Java package name - not a path: " + gluePath);
+ }
+ // We can be fairly confident that gluePath is a packageName at this point
+ for (Class<?> glueCodeClass : resourceLoader.getDescendants(Object.class, gluePath)) {
while (glueCodeClass != null && glueCodeClass != Object.class && !Utils.isInstantiable(glueCodeClass)) {
// those can't be instantiated without container class present.
glueCodeClass = glueCodeClass.getSuperclass();
11 java/src/test/java/cucumber/runtime/java/JavaBackendTest.java
View
@@ -1,6 +1,7 @@
package cucumber.runtime.java;
import cucumber.fallback.runtime.java.DefaultJavaObjectFactory;
+import cucumber.runtime.CucumberException;
import cucumber.runtime.Glue;
import cucumber.runtime.HookDefinition;
import cucumber.runtime.StepDefinition;
@@ -19,12 +20,20 @@
import static org.junit.Assert.assertEquals;
public class JavaBackendTest {
+ @Test(expected = CucumberException.class)
+ public void doesnt_like_path_like_glue() {
+ ObjectFactory factory = new DefaultJavaObjectFactory();
+ JavaBackend backend = new JavaBackend(factory);
+ GlueStub world = new GlueStub();
+ backend.loadGlue(world, asList("cucumber/runtime/java/test"));
+ }
+
@Test
public void finds_step_definitions_by_scanning_for_annotations() {
ObjectFactory factory = new DefaultJavaObjectFactory();
JavaBackend backend = new JavaBackend(factory);
GlueStub world = new GlueStub();
- backend.loadGlue(world, asList("cucumber/runtime/java/test"));
+ backend.loadGlue(world, asList("cucumber.runtime.java.test"));
backend.buildWorld();
assertEquals(Stepdefs.class, factory.getInstance(Stepdefs.class).getClass());
}
2  jruby/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-jruby</artifactId>
2  junit/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-junit</artifactId>
11 junit/src/main/java/cucumber/junit/RuntimeOptionsFactory.java
View
@@ -6,6 +6,7 @@
import java.util.Collections;
import java.util.List;
+import static cucumber.runtime.Utils.packageName;
import static cucumber.runtime.Utils.packagePath;
public class RuntimeOptionsFactory {
@@ -44,12 +45,18 @@ private void addDryRun(Cucumber.Options options, List<String> args) {
private void addMonochrome(Cucumber.Options options, List<String> args) {
if (options != null) {
- if (options.monochrome()) {
+ if (options.monochrome() || runningInEnvironmentWithoutAnsiSupport()) {
args.add("--monochrome");
}
}
}
+ private boolean runningInEnvironmentWithoutAnsiSupport() {
+ boolean intelliJidea = System.getProperty("idea.launcher.bin.path") != null;
+ // TODO: What does Eclipse use?
+ return intelliJidea;
+ }
+
private void addGlue(Cucumber.Options options, Class clazz, List<String> args) {
if (options != null && options.glue().length != 0) {
for (String glue : options.glue()) {
@@ -58,7 +65,7 @@ private void addGlue(Cucumber.Options options, Class clazz, List<String> args) {
}
} else {
args.add("--glue");
- args.add(packagePath(clazz));
+ args.add(packageName(clazz));
}
}
2  jython/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-jython</artifactId>
2  openejb/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-openejb</artifactId>
2  picocontainer/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-picocontainer</artifactId>
2  pom.xml
View
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
- <version>1.0.1</version>
+ <version>1.0.2</version>
<packaging>pom</packaging>
<name>Cucumber-JVM</name>
<url>http://cukes.info/</url>
2  rhino/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-rhino</artifactId>
2  scala/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-scala</artifactId>
2  scala/src/main/scala/cucumber/runtime/ScalaSnippet.scala
View
@@ -10,7 +10,7 @@ class ScalaSnippetGenerator extends Snippet {
def template() =
"{0}(\"\"\"{1}\"\"\")'{' ({3}) =>\n" +
" //// {4}\n" +
- " throw new PendingException()\n"
+ " throw new PendingException()\n" +
"'}'"
def tableHint() = null
2  spring/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-spring</artifactId>
2  weld/pom.xml
View
@@ -5,7 +5,7 @@
<groupId>info.cukes</groupId>
<artifactId>cucumber-jvm</artifactId>
<relativePath>../pom.xml</relativePath>
- <version>1.0.1</version>
+ <version>1.0.2</version>
</parent>
<artifactId>cucumber-weld</artifactId>

No commit comments for this range

Something went wrong with that request. Please try again.