java.lang.IllegalArgumentException: Test class can only have one constructor

jayway.com | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Using another JUnit Runner with PowerMock - Jayway

    jayway.com | 1 year ago
    java.lang.IllegalArgumentException: Test class can only have one constructor
  2. 0

    Using another JUnit Runner with PowerMock - Jayway

    jayway.com | 6 months ago
    java.lang.IllegalArgumentException: Test class can only have one constructor
  3. 0

    RobolectricTestRunner, Test class can only have one constructor

    Stack Overflow | 3 years ago | jakk
    java.lang.IllegalArgumentException: Test class can only have one constructor
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Robolectric & Junit

    Stack Overflow | 3 years ago | Yasir
    java.lang.IllegalArgumentException: Test class can only have one constructor

    2 unregistered visitors

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Test class can only have one constructor

      at org.junit.runners.model.TestClass.<init>()
    2. JUnit
      BlockJUnit4ClassRunner.<init>
      1. org.junit.runners.model.TestClass.<init>(TestClass.java:40)
      2. org.junit.runners.ParentRunner.<init>(ParentRunner.java:75)
      3. org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:57)
      3 frames
    3. Spring TestContext
      SpringJUnit4ClassRunner.<init>
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:104)
      1 frame
    4. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      4 frames
    5. powermock-reflect
      Whitebox.invokeConstructor
      1. org.powermock.reflect.internal.WhiteboxImpl.createInstance(WhiteboxImpl.java:1428)
      2. org.powermock.reflect.internal.WhiteboxImpl.invokeConstructor(WhiteboxImpl.java:1301)
      3. org.powermock.reflect.Whitebox.invokeConstructor(Whitebox.java:497)
      3 frames
    6. powermock-module-junit4
      DelegatingPowerMockRunner.<init>
      1. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner$1.call(DelegatingPowerMockRunner.java:96)
      2. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner$1.call(DelegatingPowerMockRunner.java:93)
      3. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner.withContextClassLoader(DelegatingPowerMockRunner.java:127)
      4. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner.createDelegate(DelegatingPowerMockRunner.java:92)
      5. org.powermock.modules.junit4.internal.impl.DelegatingPowerMockRunner.<init>(DelegatingPowerMockRunner.java:60)
      5 frames
    7. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      4 frames
    8. powermock-module-junit4-common
      JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader
      1. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:156)
      2. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.createDelegatorFromClassloader(JUnit4TestSuiteChunkerImpl.java:40)
      2 frames
    9. powermock-core
      AbstractTestSuiteChunkerImpl.createTestDelegators
      1. org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.createTestDelegators(AbstractTestSuiteChunkerImpl.java:244)
      1 frame
    10. powermock-module-junit4-common
      AbstractCommonPowerMockRunner.<init>
      1. org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<init>(JUnit4TestSuiteChunkerImpl.java:61)
      2. org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<init>(AbstractCommonPowerMockRunner.java:32)
      2 frames
    11. powermock-module-junit4
      PowerMockRunner.<init>
      1. org.powermock.modules.junit4.PowerMockRunner.<init>(PowerMockRunner.java:34)
      1 frame
    12. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      4 frames
    13. JUnit
      FilterRequest.getRunner
      1. org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
      2. org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
      3. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      4. org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
      5. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      6. org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
      7. org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:31)
      7 frames
    14. JUnit4 Runner
      JUnit4TestLoader.loadTests
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
      2. org.eclipse.jdt.internal.junit4.runner.JUnit4TestMethodReference.<init>(JUnit4TestMethodReference.java:25)
      3. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:54)
      4. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
      4 frames
    15. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      4 frames