History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-13439
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Alexey Kudravtsev
Reporter: Mikhail Gedzberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Attempt to debug ONLY method of parameterized class failed with exception in console

Created: 19 Jan 07 17:53   Updated: 06 Nov 08 23:25
Component/s: Unit Testing. JUnit
Fix Version/s: Undefined

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 6,656


 Description  « Hide
java.lang.Exception: Test class should have public zero-argument constructor
at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:54)
at org.junit.internal.runners.MethodValidator.validateAllMethods(MethodValidator.java:39)
at com.intellij.rt.junit4.Junit4TestMethodAdapter.run(Junit4TestMethodAdapter.java:39)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.NoSuchMethodException: junitfaq.AdditionTest.<init>()
at java.lang.Class.getConstructor0(Class.java:2647)
at java.lang.Class.getConstructor(Class.java:1629)
at org.junit.internal.runners.MethodValidator.validateNoArgConstructor(MethodValidator.java:52)
... 13 more

Process finished with exit code -1



 All   Comments   Work Log   Change History      Sort Order:
Mikhail Gedzberg - 19 Jan 07 17:53
Here is an example:
package junitfaq;

import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.Test;
import org.junit.Ignore;
import static org.junit.Assert.*;

import java.util.LinkedList;

@RunWith(Parameterized.class)
public class AdditionTest {

private int x, y;

public AdditionTest(int x, int y) { this.x = x; this.y = y; }

@Test
public void addition() { int z = x + y; assertEquals(2, z); }

@Ignore
@Test
public void additionAgain() { // }

@Parameterized.Parameters
public static LinkedList data() {
LinkedList params = new LinkedList();
params.add(new Integer[] {1, 1});
return params;
}

}

P.S. I tried to debug addition() method.