Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring towards internal DI. This can potentially simplify some o…
…f the internal codebase, and also accommodate for #330.
- Loading branch information
1 parent
adbacc7
commit 450cc84
Showing
23 changed files
with
46 additions
and
112 deletions.
There are no files selected for viewing
5 changes: 1 addition & 4 deletions
5
...untime/java/DefaultJavaObjectFactory.java → ...ber/runtime/DefaultJavaObjectFactory.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package cucumber.runtime; | ||
|
||
import cucumber.io.ClasspathResourceLoader; | ||
|
||
public interface ObjectFactory { | ||
void start(); | ||
|
||
void stop(); | ||
|
||
void addClass(Class<?> clazz); | ||
|
||
<T> T getInstance(Class<T> type); | ||
|
||
public class Factory { | ||
public static ObjectFactory newInstance(ClasspathResourceLoader classpathResourceLoader) { | ||
try { | ||
return classpathResourceLoader.instantiateExactlyOneSubclass(ObjectFactory.class, "cucumber.runtime", new Class[0], new Object[0]); | ||
} catch (CucumberException ce) { | ||
return new DefaultJavaObjectFactory(); | ||
} | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
guice/src/test/java/cucumber/runtime/java/guice/GuiceFactoryTest.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
1 change: 1 addition & 0 deletions
1
java/src/main/java/cucumber/runtime/java/JavaHookDefinition.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
11 changes: 0 additions & 11 deletions
11
java/src/main/java/cucumber/runtime/java/ObjectFactory.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
java/src/main/java/cucumber/runtime/java/ObjectFactoryHolder.java
This file was deleted.
Oops, something went wrong.
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
3 changes: 2 additions & 1 deletion
3
java/src/test/java/cucumber/runtime/java/JavaObjectFactoryTest.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
52 changes: 0 additions & 52 deletions
52
java/src/test/java/cucumber/runtime/java/ObjectFactoryHolderTest.java
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
java/src/test/java/cucumber/runtime/java/SingletonFactory.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
2 changes: 1 addition & 1 deletion
2
openejb/src/test/java/cucumber/runtime/java/openejb/OpenEJBObjectFactoryTest.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
2 changes: 1 addition & 1 deletion
2
picocontainer/src/main/java/cucumber/runtime/java/picocontainer/PicoFactory.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
2 changes: 1 addition & 1 deletion
2
picocontainer/src/test/java/cucumber/runtime/java/picocontainer/PicoFactoryTest.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
2 changes: 1 addition & 1 deletion
2
spring/src/main/java/cucumber/runtime/java/spring/SpringFactory.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
2 changes: 1 addition & 1 deletion
2
spring/src/test/java/cucumber/runtime/java/spring/SpringFactoryTest.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
2 changes: 1 addition & 1 deletion
2
weld/src/test/java/cucumber/runtime/java/weld/WeldFactoryTest.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