analytix test generation:ejb3 nullpointerexceptions

CodePro AnalytiX (Audit & Test), includes over 1000 audit rules and metrics, JUnit test generation & editing, code coverage, and duplicate code analysis

Moderators: gnebling, jwren, Eric Clayberg, Dan Rubel, Brian Wilkerson, dcarew

analytix test generation:ejb3 nullpointerexceptions

Postby dhartford » Wed Mar 23, 2011 11:26 am

I'm testing out analytix's test generation for EJB3 - has this worked in the past and I just having something way off?

seeing issues like this:
Code: Select all
   public void testCreateDosage_fixture_1()
      throws Exception {
      DosageManagerBean fixture2 = getFixture();
      Dosage ref = EasyMock.createMock(Dosage.class);
      // add mock object expectations here

      EasyMock.replay(ref);

      Dosage result = fixture2.createDosage(ref);

      // add additional test code here
      EasyMock.verify(ref);
      // An unexpected exception was thrown in user code while executing this test:
      //    java.lang.NullPointerException
      //       at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:556)
      //       at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(MethodInvocationExpression.java:550)
      //       at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(ExecutionRequest.java:286)
      //       at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(LocalExecutionClient.java:158)
      //       at java.lang.Thread.run(Thread.java:636)
      assertNotNull(result);
   }
dhartford
 
Posts: 6
Joined: Fri Oct 08, 2010 6:16 am

Re: analytix test generation:ejb3 nullpointerexceptions

Postby dhartford » Wed Mar 23, 2011 11:51 am

linux desktop, Eclipse 3.6sr1, codepro analytix 7.0.0.r36x201009141310
dhartford
 
Posts: 6
Joined: Fri Oct 08, 2010 6:16 am

Re: analytix test generation:ejb3 nullpointerexceptions

Postby gnebling » Mon Apr 25, 2011 8:48 am

Looks like a bug although the mock stuff should still work. Try deleting the NPE text, fill in your mock expectation (after the // add mock object expectations here) line, and use the generated tests.
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am


Return to CodePro AnalytiX & PlusPak. EclipsePro Audit & Test

Who is online

Users browsing this forum: No registered users and 1 guest

cron