Bailey Campbell created NETBEANS-2227:
-----------------------------------------

             Summary: Create/Update JUnit tests - Null Pointer exception on 
build
                 Key: NETBEANS-2227
                 URL: https://issues.apache.org/jira/browse/NETBEANS-2227
             Project: NetBeans
          Issue Type: Bug
          Components: java - JUnit
    Affects Versions: 11.0
            Reporter: Bailey Campbell


Build fails in Maven project after creating tests.

 

For the project *JUnitSampleProjectMaven*:
 # Delete the test package *Test Packages > methodaccess*.
 # Select the node *Source Packages > methodaccess > Methods.java*.
 # Right click it and select *Tools > Create/Update Tests* from the popup menu.
 # Uncheck the following checkboxes within the *Generated Comments* section:
 ** *Javadoc Comments*
 ** *Source Code Hints*
 # Also uncheck the *Integration Tests* checkbox, so that a unit test is 
created rather than an integration test.
 # Ensure all checkboxes except those three are checked, then click the *OK* 
button.
 # Select the node for the project in the *Projects* panel, then press the 
*F11* function key to build the project.

Expect Result:

*BUILD SUCCESSFUL*

Actual Result:

NullPointer exceptions as instance variable is not created and test fails.

public void testPublicMethod() {
 System.out.println("publicMethod");
 Methods instance = null;
 String expResult = "";
 String result = instance.publicMethod();
 assertEquals(expResult, result);
 fail("The test case is a prototype.");
 }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to