Questions tagged [junit3]

JUnit 3 is version 3 of the popular JUnit testing framework for Java

JUnit 3 is version 3 of the popular JUnit testing framework for Java.

Use this tag only for question related to features provided by version 3. Use for general questions.

152 questions
0
votes
1 answer

Maven 3 Junit 3 Tests Are Not Running

Tools : Maven 3 JUnit 3 Issue : I have a legacy project which uses JUnit 3. I have created a new test module with src/test/java as project structure and added JUnits 3 classes inside it. JUnits classes follow correct naming convention as -…
Atul
  • 1,560
  • 5
  • 30
  • 75
0
votes
1 answer

Ant JUnit Compile Q

i found this code snippet: Do I need to…
bmw0128
  • 13,470
  • 24
  • 68
  • 116
0
votes
2 answers

Jmeter junit not on sampler menu

I've donwloaded JMeter 3.1 and am trying to run a junit sampler. Per these instructions jmeter.apache.org/usermanual/junitsampler_tutorial.pdf I've added a ThreadGroup to test plan, i select add->sampler, but do not find Junit. This is what I see. …
0
votes
2 answers

How to create a new test class in shortkeys?

I work with android studio and I remember that I saw in some video tutorial short way to create test class. It looked like you just put mouse on name of class, right click and something like create a test and then pop up where you can choose version…
Sirop4ik
  • 4,543
  • 2
  • 54
  • 121
0
votes
2 answers

the JAR of this class file belongs to container 'Junit 4' which does not allow modifications to source attachements on its entries

I am new to Junit framework. I am trying to invoke private method in another class from Junit test class using reflection API. I am getting below error while running JUnit test: java.lang.ExceptionInInitializerError at…
Karuna
  • 719
  • 1
  • 11
  • 22
0
votes
1 answer

Issue with running JUnit test with @Test on Android. Expected annotation not working

I use Eclipse and I added JUnit4 in libraries. A have test where I expect exceptions and I use @Test annotations with parameters like this: @Test(expected = NullPointerException.class) public void setNullClassLoader() { …
BORSHEVIK
  • 794
  • 1
  • 8
  • 12
0
votes
2 answers

Mock Date object using Mockito

A method of MyService class returns java.util.Date object and MyManager class is calling that method of MyService class. I am writing the test case for MyManager class. when I mock…
user1920
  • 89
  • 1
  • 2
  • 11
0
votes
1 answer

Junit3 suite.addTest(new mytest()) get 'null' error

I create a test suite and want to add some new tests, but suite.addTest() method seems doesn't work as I expected: public static Test suite() { TestSuite suite = new TestSuite(AllTests.class.getName()); //$JUnit-BEGIN$ // This line…
Zippon
  • 177
  • 7
0
votes
1 answer

What is the recommended style of the "message" in a JUnit test?

What is the recommended style of the "message" in a JUnit test? Here is the message expressed currently: ReturnedObject ro = objectUnderTest.methodToTest(stub); Assert.assertNotNull("The object was null!", ro); Or, is this more…
djangofan
  • 28,471
  • 61
  • 196
  • 289
0
votes
1 answer

Unrooted Tests for TestSuites

I want to create a test suite builder for some common use cases in our company (like Google Guave does for collections). So I create my builder, and some classes extending either TestSuite or TestCase that get added if needed. However running…
Stefan S.
  • 3,950
  • 5
  • 25
  • 77
0
votes
1 answer

how to implements junit testing in fragments and how to implement button click in junit testing?

Button click perform and calling a method in junit3 is not working. Implementing in junit3 in android fragment is not working?
0
votes
1 answer

Junit Dynamically Created Tests Not Working

public class NewTest extends SeleneseTestCase { public static Test suite() throws Exception { TestSuite suite = new TestSuite(); TestSuite s = new TestSuite("TestCase Name"); GeneratedTest t = new GeneratedTest("testName"); …
Ring
  • 2,249
  • 5
  • 27
  • 40
0
votes
1 answer

Getting Exception "Failed to load transport: org/mule/transport D"

I am getting below exception in Junit test code in Mule. You can find my mule flow and test code here :Getting "muleContext cannot be resolved" error in mule Junit test code Can anyone help me to resove this error…
anusha
  • 5
  • 6
0
votes
1 answer

Getting "muleContext cannot be resolved" error in mule Junit test code

I am getting error "Unresolved compilation problem: muleContext cannot be resolved" at the line "MuleClient client = muleContext.getClient();" in JUnit test code in Mule. As per my understanding this code is correct. Since i am new to JUnit, i…
anusha
  • 5
  • 6
0
votes
1 answer

How do i generate a junit report with fail

I have junit testscript that creates different and unique ID. So when it finds an existing ID or a wrong Id I want the test script report via ANT to show that it is failed for following record but passed for the rest of the records that are…
Monika
  • 1
  • 1