DATACMNS-736 - Polishing.

Tweaked unit test to check for the correct wording. Polished DistanceFormatterUnitTests to actually run in a Maven build.

Original pull request: #134.
This commit is contained in:
Oliver Gierke
2015-07-21 16:49:53 +02:00
parent a597549c4e
commit 85d96c71f2
2 changed files with 16 additions and 3 deletions

View File

@@ -43,6 +43,11 @@ public class DistanceFormatterUnitTests {
static Distance REFERENCE = new Distance(10.8, Metrics.KILOMETERS);
@Test
public void testname() {
// To make sure Maven picks up the tests
}
public static class UnparameterizedTests {
/**

View File

@@ -24,8 +24,10 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Locale;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
@@ -49,11 +51,17 @@ public class PointFormatterUnitTests {
public static class UnparameterizedTests {
public @Rule ExpectedException exception = ExpectedException.none();
/**
* @see DATAREST-279, DATACMNS-626
*/
@Test(expected = IllegalArgumentException.class)
@Test
public void rejectsArbitraryNonsense() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("comma");
INSTANCE.convert("foo");
}
@@ -79,8 +87,8 @@ public class PointFormatterUnitTests {
@Parameters
public static Collection<String[]> parameters() {
return Arrays.asList(new String[] { "10.8,20.9" }, new String[] { " 10.8,20.9 " },
new String[] { " 10.8 ,20.9" }, new String[] { " 10.8, 20.9 " });
return Arrays.asList(new String[] { "10.8,20.9" }, new String[] { " 10.8,20.9 " }, new String[] { " 10.8 ,20.9" },
new String[] { " 10.8, 20.9 " });
}
public @Parameter String source;