[nbusers] Generate test class for JUnit 4 missing an import nec. for compilation

  • From: trhouse < >
  • To:
  • Subject: [nbusers] Generate test class for JUnit 4 missing an import nec. for compilation
  • Date: Wed, 21 Nov 2012 16:18:35 -0500

OK I am generating test classes for JUnit 4 using the rt click menu available over the package tools->create tests

The created test classes -BlahTest - does not compile

There a couple ways to fix it . One is by having the Blah extend junit.framework.TestCase but that's JUnit 3.x's way of doing things (it appears, newbie on a journey of discovery here...) and in JUnit 4 annotations are used which in turn that requires this import:

import static org.junit.Assert.*;


I gleaned all this from here btw:

http://stackoverflow.com/questions/291003/differences-between-2-junit-assert-classes

which works but is this a bug in the JUnit test generation or is it a feature I am not understanding...

TIA


[nbusers] Generate test class for JUnit 4 missing an import nec. for compilation

trhouse 11/21/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close