ttt307307 / junitparams

Automatically exported from code.google.com/p/junitparams
0 stars 0 forks source link

Crash with two String parameters #50

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi guys,

Your frameworks is exactly what I've been dreaming of but the code below 
crashes. This happens with JUnitParams 1.0.2, Java 1.7.0_21 on Mac OS X 10.8.4. 
When setting a breakpoint in the body of the test method, the JVM crashes. I 
get JUnitParams running nicely with a pair of ints as parameters. Any insights?

import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;

import static junitparams.JUnitParamsRunner.$;

@RunWith( JUnitParamsRunner.class )
public class MyParameterizedTest {

  @Test
  @Parameters( method = "myStrings")
  public void strings( final String s1, final String s2 ) throws Exception {
    System.out.println( "s1=" + s1 + ";s2=" + s2 ) ;
  }

  @SuppressWarnings( "UnusedDeclaration" )
  private Object[] myStrings() {
    return $( $( "foo", "bar" ), $( "boo", "baz" ) ) ;
  }
}

java.lang.NullPointerException
    at java.lang.String.length(String.java:623)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:414)
    at java.lang.StringBuilder.append(StringBuilder.java:132)
    at com.otclink.shared.model.tool.MyParameterizedTest.strings(MyParameterizedTest.java:20)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at junitparams.internal.InvokeParameterisedMethod.evaluate(InvokeParameterisedMethod.java:184)
    at junitparams.internal.ParameterisedTestMethodRunner.runMethodInvoker(ParameterisedTestMethodRunner.java:48)
    at junitparams.internal.ParameterisedTestMethodRunner.runTestMethod(ParameterisedTestMethodRunner.java:42)
    at junitparams.internal.ParameterisedTestClassRunner.runParameterisedTest(ParameterisedTestClassRunner.java:143)
    at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:405)
    at junitparams.JUnitParamsRunner.runChild(JUnitParamsRunner.java:383)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010406be58, pid=19692, tid=20739
#
# JRE version: 7.0_21-b12
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode bsd-amd64 
compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x25ee58]
#
# Failed to write core dump. Core dumps have been disabled. To enable core 
dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# .../ntellij/s_err_pid19692.log
#
# If you would like to submit a bug report, please visit:
#   http:/bugreport.sun.com/ugreport/rash.jsp
#

Original issue reported on code.google.com by laurent....@gmail.com on 17 Aug 2013 at 4:09

Attachments:

GoogleCodeExporter commented 8 years ago
Works fine for me. Also OSX. Try updating to the latest JDK.

Original comment by lipinski...@gmail.com on 26 Oct 2013 at 3:59