stackoverflowmailer / guiceyfruit

Automatically exported from code.google.com/p/guiceyfruit
0 stars 0 forks source link

GuiceyFruitTestNG testcase: Using org.guiceyfruit.modules in pom.xml throws NPE in Injectors hashmap #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps:
------
1) Develop a test case extending GuiceyTestCase, without @UseModule, as I
need more than 1 module to inject
2) Implement a test specific module extending AbstractModule, for custom
binding.
3) Since I need to inject more than one module, specify the system property
'org.guiceyfruit.modules' in maven-surefire-plugin in pom.xml.

Expected Output:
-----------------
The GuiceyTestCase's injectorManager should inject all my modules specified.

Actual Ouput:
-----------------
Throws NPE at injectorManager.beforeTest()'s map.get() (and afterTest() also).
java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
    at
org.guiceyfruit.testing.InjectorManager.beforeTest(InjectorManager.java:105)
    at
org.guiceyfruit.testing.testng.GuiceyTestCase.startTestScope(GuiceyTestCase.java
:43)

Versions used:
----------------
Google-Guice 2.0
GuiceyFruit 2.0
TestNG 5.8

Original issue reported on code.google.com by shrihar...@gmail.com on 11 Jul 2009 at 6:37

GoogleCodeExporter commented 9 years ago
any chance you could submit a little test case project that demonstrates this 
issue?

Original comment by james.st...@gmail.com on 15 Jul 2009 at 2:12

GoogleCodeExporter commented 9 years ago
I am working on it and will submit it soon.

Original comment by shrihar...@gmail.com on 16 Jul 2009 at 11:39

GoogleCodeExporter commented 9 years ago
Awesome thanks! I'm sure I'll be able to fix this really quickly once there's 
little test project/test case that 
demonstrates it

Original comment by james.st...@gmail.com on 16 Jul 2009 at 11:58

GoogleCodeExporter commented 9 years ago
Please find attached the test project with Maven POM. If you execute 'mvn test' 
you
could find the same failures in two places: startTestScope and tearDown. 

Original comment by scshrih...@gmail.com on 16 Jul 2009 at 6:10

Attachments: