Skip to content

Commit

Permalink
Build passes with cucumber-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Jun 29, 2012
1 parent 93ebf40 commit ffdf4c4
Show file tree
Hide file tree
Showing 52 changed files with 207 additions and 206 deletions.
2 changes: 1 addition & 1 deletion History.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

## [1.0.0.RC15](https://github.com/cucumber/cucumber-jvm/compare/v1.0.0.RC14...v1.0.0.RC15)

* [Java] You must use `cucumber.runtime.xstream` instead of `com.thoughtworks.xstream` for custom converters.
* [Java] You must use `cucumber.runtime.xstream` instead of `cucumber.runtime.xstream` for custom converters.
* [Core] XStream and Diffutils are now packaged inside the cucumber-core jar under new package names. ([#179](https://github.com/cucumber/cucumber-jvm/issues/179) Aslak Hellesøy)
* [Core] Fail if no features are found ([#163](https://github.com/cucumber/cucumber-jvm/issues/163) Aslak Hellesøy)
* [Core] Fail if duplicate features are detected ([#165](https://github.com/cucumber/cucumber-jvm/issues/165) Aslak Hellesøy)
Expand Down
10 changes: 5 additions & 5 deletions clojure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<scope>test</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>cucumber.runtime.xstream</groupId>-->
<!--<artifactId>xstream</artifactId>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
46 changes: 5 additions & 41 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,18 @@
<name>Cucumber-JVM: Core</name>

<dependencies>
<!-- These dependencies are not packaged because conflicts are unlikely -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<artifactId>cucumber-deps</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-html</artifactId>
</dependency>
<!-- These dependencies are packaged to prevent conflicts with users' own code -->
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<!--<scope>provided</scope>-->
<artifactId>gherkin</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.java-diff-utils</groupId>
<artifactId>diffutils</artifactId>
<scope>provided</scope>
<groupId>info.cukes</groupId>
<artifactId>cucumber-html</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -88,35 +81,6 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>jarjar-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jarjar</goal>
</goals>
<configuration>
<includes>
<include>com.thoughtworks.xstream:xstream</include>
<include>com.googlecode.java-diff-utils:diffutils</include>
</includes>
<rules>
<rule>
<pattern>com.thoughtworks.xstream.**</pattern>
<result>cucumber.runtime.xstream.@1</result>
</rule>
<rule>
<pattern>difflib.**</pattern>
<result>cucumber.difflib.@1</result>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion core/src/main/java/cucumber/api/Transform.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cucumber.api;

import com.thoughtworks.xstream.converters.SingleValueConverter;
import cucumber.runtime.xstream.converters.SingleValueConverter;

import java.lang.annotation.ElementType;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/cucumber/api/Transformer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cucumber.api;

import com.thoughtworks.xstream.converters.SingleValueConverter;
import cucumber.runtime.xstream.converters.SingleValueConverter;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
Expand Down
17 changes: 5 additions & 12 deletions core/src/main/java/cucumber/runtime/ParameterType.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package cucumber.runtime;

import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import cucumber.DateFormat;
import cucumber.api.Transform;
import cucumber.runtime.converters.EnumConverter;
import cucumber.runtime.converters.LocalizedXStreams;
import cucumber.runtime.converters.TimeConverter;
import cucumber.runtime.xstream.annotations.XStreamConverter;
import cucumber.runtime.xstream.converters.SingleValueConverter;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -74,19 +73,15 @@ public String toString() {
}

public Object convert(String value, LocalizedXStreams.LocalizedXStream xStream, Locale locale) {
TimeConverter timeConverter = null;
try {
xStream.setDateFormat(dateFormat);
SingleValueConverter converter;
xStream.processAnnotations(getRawType());

if (singleValueConverter != null) {
converter = singleValueConverter;
} else {
if (dateFormat != null) {
timeConverter = TimeConverter.getInstance(this, locale);
timeConverter.setOnlyFormat(dateFormat, locale);
converter = timeConverter;
} else if (getRawType().isEnum()) {
if (getRawType().isEnum()) {
converter = new EnumConverter(locale, (Class<? extends Enum>) getRawType());
} else {
converter = xStream.getSingleValueConverter(getRawType());
Expand All @@ -108,9 +103,7 @@ public Object convert(String value, LocalizedXStreams.LocalizedXStream xStream,
}
return converter.fromString(value);
} finally {
if (timeConverter != null) {
timeConverter.removeOnlyFormat();
}
xStream.unsetDateFormat();
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.converters.SingleValueConverter;
import cucumber.runtime.CucumberException;
import cucumber.runtime.xstream.converters.SingleValueConverter;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.converters.ConversionException;
import cucumber.runtime.xstream.converters.ConversionException;

import java.text.FieldPosition;
import java.text.Format;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import cucumber.runtime.CucumberException;
import cucumber.runtime.xstream.converters.ConversionException;
import cucumber.runtime.xstream.converters.SingleValueConverter;

import java.text.Format;
import java.text.ParsePosition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.ConverterLookup;
import com.thoughtworks.xstream.converters.ConverterRegistry;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.core.DefaultConverterLookup;
import cucumber.runtime.xstream.XStream;
import cucumber.runtime.xstream.converters.Converter;
import cucumber.runtime.xstream.converters.ConverterLookup;
import cucumber.runtime.xstream.converters.ConverterRegistry;
import cucumber.runtime.xstream.converters.SingleValueConverter;
import cucumber.runtime.xstream.core.DefaultConverterLookup;

import java.lang.reflect.Type;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.converters.SingleValueConverterWrapper;
import cucumber.runtime.xstream.converters.SingleValueConverter;
import cucumber.runtime.xstream.converters.SingleValueConverterWrapper;

/**
* Subclass that exposes the wrapped converter
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/cucumber/table/TableConverter.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cucumber.table;

import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import cucumber.runtime.CucumberException;
import cucumber.runtime.converters.LocalizedXStreams;
import cucumber.runtime.xstream.converters.ConversionException;
import cucumber.runtime.xstream.converters.SingleValueConverter;
import cucumber.runtime.xstream.converters.reflection.AbstractReflectionConverter;
import cucumber.runtime.xstream.io.HierarchicalStreamReader;
import cucumber.table.xstream.CellWriter;
import cucumber.table.xstream.ComplexTypeWriter;
import cucumber.table.xstream.ListOfComplexTypeReader;
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/cucumber/table/TableDiffer.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cucumber.table;

import difflib.Delta;
import difflib.DiffUtils;
import difflib.Patch;
import cucumber.difflib.Delta;
import cucumber.difflib.DiffUtils;
import cucumber.difflib.Patch;
import gherkin.formatter.model.DataTableRow;
import gherkin.formatter.model.Row;

Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/cucumber/table/xstream/CellWriter.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cucumber.table.xstream;

import com.thoughtworks.xstream.io.AbstractWriter;
import cucumber.table.DataTable;
import cucumber.runtime.xstream.io.AbstractWriter;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package cucumber.table.xstream;

import cucumber.runtime.CucumberException;

import java.util.ArrayList;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cucumber.table.xstream;

import com.thoughtworks.xstream.converters.ErrorWriter;
import com.thoughtworks.xstream.io.AbstractReader;
import cucumber.runtime.xstream.converters.ErrorWriter;
import cucumber.runtime.xstream.io.AbstractReader;

import java.util.Collections;
import java.util.Iterator;
Expand Down
2 changes: 0 additions & 2 deletions core/src/test/java/cucumber/formatter/StubFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import gherkin.formatter.model.Scenario;
import gherkin.formatter.model.ScenarioOutline;
import gherkin.formatter.model.Step;
import org.junit.Ignore;

import java.io.File;
import java.util.List;

public class StubFormatter implements Formatter {
Expand Down
3 changes: 2 additions & 1 deletion core/src/test/java/cucumber/io/FileResourceTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cucumber.io;

import org.junit.Test;

import java.io.File;

import org.junit.Test;
import static org.junit.Assert.assertEquals;

public class FileResourceTest {
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/cucumber/runtime/ParameterTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void converts_with_built_in_converter() throws NoSuchMethodException {
public void withCustomTransform(@Transform(UppercasedTransformer.class) Uppercased uppercased) {
}

private class Uppercased {
public static class Uppercased {
public String value;

public Uppercased(String value) {
Expand All @@ -35,7 +35,7 @@ public Uppercased(String value) {
}
}

private class UppercasedTransformer extends Transformer<Uppercased> {
public static class UppercasedTransformer extends Transformer<Uppercased> {
@Override
public Uppercased transform(String value) {
return new Uppercased(value.toUpperCase());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cucumber.runtime;

import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import cucumber.runtime.converters.LocalizedXStreams;
import cucumber.runtime.xstream.annotations.XStreamConverter;
import cucumber.runtime.xstream.converters.basic.AbstractSingleValueConverter;
import gherkin.I18n;
import gherkin.formatter.Argument;
import gherkin.formatter.model.DataTableRow;
Expand Down Expand Up @@ -106,10 +106,10 @@ public void gives_nice_error_message_when_conversion_fails() throws Throwable {
fail();
} catch (CucumberException expected) {
assertEquals(
"Don't know how to convert blah into cucumber.runtime.StepDefinitionMatchTest$Thang.\n" +
"Don't know how to convert \"blah\" into cucumber.runtime.StepDefinitionMatchTest$Thang.\n" +
"Try writing your own converter:\n" +
"\n" +
"@com.thoughtworks.xstream.annotations.XStreamConverter(ThangConverter.class)\n" +
"@cucumber.runtime.xstream.annotations.XStreamConverter(ThangConverter.class)\n" +
"public class Thang {}\n",
expected.getMessage()
);
Expand Down
5 changes: 0 additions & 5 deletions core/src/test/java/cucumber/runtime/UtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

import org.junit.Test;

import java.util.concurrent.TimeoutException;

import static cucumber.runtime.Utils.isInstantiable;
import static java.lang.Thread.sleep;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

public class UtilsTest {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.converters.ConverterLookup;
import com.thoughtworks.xstream.converters.SingleValueConverter;
import cucumber.runtime.xstream.converters.ConverterLookup;
import cucumber.runtime.xstream.converters.SingleValueConverter;
import org.junit.Test;

import java.math.BigDecimal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cucumber.runtime.converters;

import com.thoughtworks.xstream.converters.ConversionException;
import cucumber.runtime.xstream.converters.ConversionException;
import org.junit.Test;

import java.math.BigDecimal;
Expand Down
1 change: 0 additions & 1 deletion core/src/test/java/cucumber/table/DataTableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/cucumber/table/FromDataTableTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package cucumber.table;

import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.javabean.JavaBeanConverter;
import cucumber.DateFormat;
import cucumber.api.Transformer;
import cucumber.runtime.StepDefinition;
import cucumber.runtime.StepDefinitionMatch;
import cucumber.runtime.StubStepDefinition;
import cucumber.runtime.converters.LocalizedXStreams;
import cucumber.runtime.xstream.annotations.XStreamConverter;
import cucumber.runtime.xstream.converters.javabean.JavaBeanConverter;
import gherkin.I18n;
import gherkin.formatter.Argument;
import gherkin.formatter.model.Comment;
Expand Down
Loading

0 comments on commit ffdf4c4

Please sign in to comment.