How to run all JUnit tests of a given package?
I use JUnit 4 in eclipse. I have some test classes in my package and want to run them all. How? ...
I use JUnit 4 in eclipse. I have some test classes in my package and want to run them all. How? ...
I am doing some table testing in word, all of the JUnits are done but i am having trouble testing a method - as i am the tester in this project and not the coder i am struggling to understand what is actually correct or not public GregorianCalendar calcDeparture(String date, String time) { String[] calDate = new String[3]; ...
I wanna use junit 3. Is there such functionality to run all tests by using console in junit 3. If not, does junit 4 support it? ...
Here's the target I'm using to run my tests: <target name="run-tests" description="run the tests" depends="compilation"> <junit> <sysproperty key="tests.basedir" value="${SPECIAL_PATH}/unit_tests"/> <classpath> <pathelement location="${COMPILED_CLASSES}"/> <pathelement loca...
I am using ant for my project and I have been trying to generate JUnit report using ant target. The problem I run in to is that at the end of the execution my TESTS-TestSuites.xml is empty. But all the other individual test xml files have data. And due to this my html reports are empty, in the sense results shows "0". Here is my ant tar...
Hi all! Please, tell me: How can I write unit test (e.g. with JUnit) for operation "insert into some table" when many properties for normal application work are saved in config files for application server? Thanks!a ...
I try to write an big test class. I'm using Junit, Hibernate and TopLink and H2 database. Before this I used EJB3Unit (including Hibernate and H2). My test class has 57 test methods. If I run all test at once randomized one or more test fails. If I run each test alone, I get no error. Has anyone an idea what's going wrong? And how I c...
I have following tests structure: public class WorkerServiceTest { public class RaiseErrorTest extends AbstractDbUnitTest{ @Test public void testSomething(){ } ... } ... } It's done because I don't want to create a separate class file for every test case extending AbstractDbUnitTest. Th...
I am new to JUnit and Android and good test documentation for working with Android is hard to find. I have a test project with classes that extend ActivityInstrumentationTestCase2. Simple tests to examine the state of the GUI (what's enabled, relative positions, etc) work as expected. However when I attempt to perform button click act...
I would like to be able to run a set of unit tests by linking to them in my application (e.g. I want to be able to click on a link and have it run a set of jUnit tests). The problem is that GWT and jUnit don't seem to be designed for this capability -- only at build time can you run the tests it seems. I would like to be able to includ...
I'm trying to setup a simple Jetty ServletTester with a servlet from a colleague. But now the initialization of the log4j Logger fails, giving me a bunch of exceptions. Do I need to setup permissions on the ServletTester startup? This is the line in my servlet: private static final Logger LOG = Logger.getLogger( MyServlet.class ); ...
having problems trying to run by unit test with Ant, my test class uses Jmock; @RunWith(JMock.class) and annotations to identify each test method. When i attempt to build with ant (1.7.1) i get a [junit] No tests found in MyTestClass [junit] junit.framework.AssertionFailedError: No tests found Any suggestions? ...
Hello I am writing a Junit test framework to test web services. There is a requirement for the input values to come from many different sources, eg an earlier web service call or literals within the class. To achieve this I have constructors that accept the different inputs in different ways; all simple so far. The problem is the web...
Hi, I'm trying to setup a test in JUnit w/ EasyMock and I'm running into a small issue that I can't seem to wrap my head around. I was hoping someone here could help. Here is a simplified version of the method I'm trying to test: public void myMethod() { //Some code executing here Obj myObj = this.service.getObj(param); i...
I'm trying to create a test that simulates a system failure to ensure the integrity of a Oracle Berkeley DB XML database. Data loss is currently being experienced during an insert operation so I'd like to setup a test that starts inserting an arbitrary number of documents and sack the process along the way (akin to someone yanking the po...
Hey guys, I have a j2ee app which I am building with Netbeans. My task is to modify the build.xml so that after the app builds, ANT deploys the app to a server, runs Junit tasks on the app, and then un-deploys the app. So far I have the deploy and un-deploy working but I'm running into some trouble running the junit tasks. I have a c...
Hello All I have a web tool which when queried returns generated Java classes based upon the arguments in the URL. The classes we retrieve from the webserver change daily and we need to ensure that they still can process known inputs. Note these classes do not test the webserver, they run locally and transform xml into a custom format...
I am using JUnit 3 and have a situation where often I have to test that an object is created correctly. My idea was to write a class MyTestBase as shown below and then extend from that for the situation specific unit tests. However in the example I've given, MyTests does not run the tests in MyTestBase. public class MyTestBase extends...
I have some Java library code which sometimes runs as an unsigned applet. Because of this it is not always allowed to do some operations (for instance checking for system properties). I would like to run some unit tests with an Applet-like security manager so that I can verify that the code is either not performing any restricted oper...
I'm trying to ensure that a parameter can't be null by adding an assert statement at the top of the method. When unit testing, I'm trying to declare that the AssertError is expected, but it still gets recognized as a failed test even though it's behaviour is correct (AssertError is getting thrown). class ExampleTest { @Test(expected...