ttt307307 / junitparams

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

Inconsistent NPE error with Ant vs Maven on Windows 7 #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Open FakeAcutionServerTests.java
2.  Uncomment one test at a time
3.  Run: ant -f build_131027_juintparams_rca.xml compile runtest 
-DtestClass=FakeAuctionServerTests
4.  Run: mvn -f pom_131027_junitparams_rca.xml -Dtest=FakeAuctionServerTests 
test

What is the expected output? What do you see instead?
I expected either Ant Junit task output indicating test success or Maven 
Surefire output indicating test success. Instead I saw NPE errors in 3 tests 
run with ant and unexpected test failures with 1 test run with Maven. Please 
see the result_*.txt files for test run output redirected to log files.

What version of the product are you using? On what operating system?
JUnitParams-1.0.3-SNAPSHOT.jar (built from rev 177); Windows 7 Home Premium 
(64bit); Ant 1.9.2; Maven 3.1.1; JDK 7u45; Junit 4.11; Hamcrest 1.3

Please provide any additional information below.
I'm studying "Growing Object-Oriented Software, Guided by Tests"; currently on 
p. 93-93. At present, I need a bit of code that parses commands from an XMPP 
message: commands "BID" and "JOIN". I wrote separate tests with JUnit, saw they 
were redundant, tried Junit parameterized tests, and saw that they do suck. 
Found Junitparms, wrote a simple parameterized test with parameters in 
annotation. Then saw NPE error. Initially, it looked like it was due to issue 
46. However, during some experiments, I suspected the error is with Ant or 
Maven rather than with JUnitParams. My attached file contains the app and test 
code I'm using. I did my best to make it easy for you to reproduce my 
experiments without much effort.

Maven works for my purposes, but ant runs faster. So I would like to see a 
solution, but I leave that decision up to you.

Thanks.

Mike Rocha
Sunrise, FL USA

Original issue reported on code.google.com by openmi...@gmail.com on 3 Nov 2013 at 4:58

Attachments:

GoogleCodeExporter commented 8 years ago
I've had a quick look at your project and there's almost certainly something 
wrong with the setup and libraries. If you move your "failing" tests into a 
fresh project and run them from your IDE or Maven, they behave properly.

Original comment by lipinski...@gmail.com on 15 Apr 2014 at 8:44