Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5df9613
commit aecd8b8
Showing
47 changed files
with
355 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 38 additions & 38 deletions
76
examples/java-webbit-websockets-selenium/src/test/resources/.cucumber/stepdefs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
[ | ||
{ | ||
"source": "^I am on the front page$", | ||
"flags": "", | ||
"steps": [ | ||
{ | ||
"name": "I am on the front page", | ||
"args": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"source": "^I enter (.+) Celcius$", | ||
"flags": "", | ||
"steps": [ | ||
{ | ||
"name": "I enter 0 Celcius", | ||
"args": [ | ||
{ | ||
"offset": 8, | ||
"val": "0" | ||
} | ||
{ | ||
"source": "^I am on the front page$", | ||
"flags": "", | ||
"steps": [ | ||
{ | ||
"name": "I am on the front page", | ||
"args": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"source": "^I should see (.+) Fahrenheit$", | ||
"flags": "", | ||
"steps": [ | ||
{ | ||
"name": "I should see 32.0 Fahrenheit", | ||
"args": [ | ||
{ | ||
"offset": 13, | ||
"val": "32.0" | ||
} | ||
}, | ||
{ | ||
"source": "^I enter (.+) Celcius$", | ||
"flags": "", | ||
"steps": [ | ||
{ | ||
"name": "I enter 0 Celcius", | ||
"args": [ | ||
{ | ||
"offset": 8, | ||
"val": "0" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"source": "^I should see (.+) Fahrenheit$", | ||
"flags": "", | ||
"steps": [ | ||
{ | ||
"name": "I should see 32.0 Fahrenheit", | ||
"args": [ | ||
{ | ||
"offset": 13, | ||
"val": "32.0" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
scriptDir = new File(getClass().protectionDomain.codeSource.location.path).getParent(); | ||
if(this.class.classLoader.rootLoader) this.class.classLoader.rootLoader.addURL(new File(scriptDir, "cucumber-groovy-full.jar").toURL()) | ||
if (this.class.classLoader.rootLoader) this.class.classLoader.rootLoader.addURL(new File(scriptDir, "cucumber-groovy-full.jar").toURL()) | ||
this.class.classLoader.loadClass("cucumber.cli.Main").main(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
guice/src/main/java/cucumber/runtime/java/guice/GuiceModuleInstantiationFailed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
guice/src/main/java/cucumber/runtime/java/guice/ModuleInstantiator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 11 additions & 13 deletions
24
guice/src/test/java/cucumber/runtime/java/guice/ModuleInstantiatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,38 @@ | ||
package cucumber.runtime.java.guice; | ||
|
||
import com.google.inject.Module; | ||
import cucumber.runtime.java.guice.loadguicemodule.YourModuleClass; | ||
import org.junit.Test; | ||
|
||
import static org.hamcrest.CoreMatchers.instanceOf; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.assertThat; | ||
|
||
import org.junit.Test; | ||
|
||
import com.google.inject.Module; | ||
|
||
import cucumber.runtime.java.guice.loadguicemodule.YourModuleClass; | ||
|
||
public class ModuleInstantiatorTest { | ||
private final ModuleInstantiator instantiator = new ModuleInstantiator(); | ||
|
||
@Test | ||
public void instantiatesModuleByFullyQualifiedName() throws Exception { | ||
assertThat(instantiate(YourModuleClass.class), is(instanceOf(YourModuleClass.class))); | ||
} | ||
|
||
@Test(expected=GuiceModuleInstantiationFailed.class) | ||
@Test(expected = GuiceModuleInstantiationFailed.class) | ||
public void fails_to_instantiate_non_existant_class() throws Exception { | ||
instantiator.instantiate("some.bogus.Class"); | ||
} | ||
@Test(expected=GuiceModuleInstantiationFailed.class) | ||
|
||
@Test(expected = GuiceModuleInstantiationFailed.class) | ||
public void fails_to_instantiate_class_not_implementing_module() throws Exception { | ||
instantiate(String.class); | ||
} | ||
@Test(expected=GuiceModuleInstantiationFailed.class) | ||
|
||
@Test(expected = GuiceModuleInstantiationFailed.class) | ||
public void fails_to_instantiate_class_with_private_constructor() throws Exception { | ||
instantiate(PrivateConstructor.class); | ||
} | ||
|
||
private Module instantiate(Class<?> moduleClass) { | ||
String moduleClassName = moduleClass.getCanonicalName(); | ||
return instantiator.instantiate(moduleClassName).get(0); | ||
} | ||
} | ||
} |
9 changes: 4 additions & 5 deletions
9
guice/src/test/java/cucumber/runtime/java/guice/loadguicemodule/SecondSteps.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
guice/src/test/java/cucumber/runtime/java/guice/loadguicemodule/loadguicemodule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package cucumber.runtime.java.guice.loadguicemodule; | ||
|
||
import org.junit.runner.RunWith; | ||
|
||
import cucumber.junit.Cucumber; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(Cucumber.class ) | ||
@RunWith(Cucumber.class) | ||
public class loadguicemodule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.