forked from junit-team/junit4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request junit-team#485 from awulder/issue-55
Fix for issue junit-team#55
- Loading branch information
Showing
2 changed files
with
83 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...rg/junit/tests/experimental/theories/runner/TypeMatchingBetweenMultiDataPointsMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.junit.tests.experimental.theories.runner; | ||
|
||
import static org.junit.Assert.assertThat; | ||
import static org.junit.experimental.results.PrintableResult.testResult; | ||
import static org.junit.experimental.results.ResultMatchers.isSuccessful; | ||
|
||
import org.junit.Test; | ||
import org.junit.experimental.theories.DataPoint; | ||
import org.junit.experimental.theories.DataPoints; | ||
import org.junit.experimental.theories.Theories; | ||
import org.junit.experimental.theories.Theory; | ||
import org.junit.runner.RunWith; | ||
|
||
public class TypeMatchingBetweenMultiDataPointsMethod { | ||
|
||
@RunWith(Theories.class) | ||
public static class WithWrongfullyTypedDataPointsMethod { | ||
@DataPoint | ||
public static String[] correctlyTyped = {"Good", "Morning"}; | ||
|
||
@DataPoints | ||
public static String[] wrongfullyTyped() { | ||
return new String[]{"Hello", "World"}; | ||
} | ||
|
||
@Theory | ||
public void testTheory(String[] array) { | ||
} | ||
} | ||
|
||
@Test | ||
public void ignoreWrongTypedDataPointsMethod() { | ||
assertThat(testResult(WithWrongfullyTypedDataPointsMethod.class), isSuccessful()); | ||
} | ||
|
||
@RunWith(Theories.class) | ||
public static class WithCorrectlyTypedDataPointsMethod { | ||
@DataPoint | ||
public static String[] correctlyTyped = {"Good", "Morning"}; | ||
|
||
@DataPoints | ||
public static String[][] anotherCorrectlyTyped() { | ||
return new String[][]{ | ||
{"Hello", "World"} | ||
}; | ||
} | ||
|
||
@Theory | ||
public void testTheory(String[] array) { | ||
} | ||
} | ||
|
||
@Test | ||
public void pickUpMultiPointDataPointMethods() throws Exception { | ||
assertThat(testResult(WithCorrectlyTypedDataPointsMethod.class), isSuccessful()); | ||
} | ||
} |