mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-06-01 01:11:36 +00:00
Remove extraneous tests.
The burntsushi tests provide adequate coverage of these.
This commit is contained in:
parent
b550e638c7
commit
f3dca7d24f
|
@ -89,7 +89,7 @@ public class ValueWriterTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void should_write_nested_map() {
|
public void should_write_nested_map_with_default_indentation_policy() {
|
||||||
String output = new TomlWriter().write(buildNestedMap());
|
String output = new TomlWriter().write(buildNestedMap());
|
||||||
String expected = "aBoolean = true\n\n" +
|
String expected = "aBoolean = true\n\n" +
|
||||||
"[aMap]\n" +
|
"[aMap]\n" +
|
||||||
|
@ -154,18 +154,6 @@ public class ValueWriterTest {
|
||||||
assertEquals(expected, output);
|
assertEquals(expected, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void should_write_array_of_primitive() {
|
|
||||||
class ArrayTest {
|
|
||||||
int[] array = {1, 2, 3};
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayTest arrayTest = new ArrayTest();
|
|
||||||
String output = new TomlWriter().write(arrayTest);
|
|
||||||
String expected = "array = [ 1, 2, 3 ]\n";
|
|
||||||
assertEquals(expected, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void should_write_array_of_tables() {
|
public void should_write_array_of_tables() {
|
||||||
class Table {
|
class Table {
|
||||||
|
@ -237,69 +225,6 @@ public class ValueWriterTest {
|
||||||
assertEquals("[b.c]\nanInt = 1\n", new TomlWriter().write(new A()));
|
assertEquals("[b.c]\nanInt = 1\n", new TomlWriter().write(new A()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void should_write_nested_arrays_of_tables() {
|
|
||||||
class Physical {
|
|
||||||
String color;
|
|
||||||
String shape;
|
|
||||||
}
|
|
||||||
class Variety {
|
|
||||||
String name;
|
|
||||||
}
|
|
||||||
class Fruit {
|
|
||||||
Physical physical;
|
|
||||||
Variety[] variety;
|
|
||||||
String name;
|
|
||||||
}
|
|
||||||
class Basket {
|
|
||||||
Fruit[] fruit;
|
|
||||||
}
|
|
||||||
|
|
||||||
Basket basket = new Basket();
|
|
||||||
basket.fruit = new Fruit[2];
|
|
||||||
|
|
||||||
basket.fruit[0] = new Fruit();
|
|
||||||
basket.fruit[0].name = "apple";
|
|
||||||
basket.fruit[0].physical = new Physical();
|
|
||||||
basket.fruit[0].physical.color = "red";
|
|
||||||
basket.fruit[0].physical.shape = "round";
|
|
||||||
basket.fruit[0].variety = new Variety[2];
|
|
||||||
basket.fruit[0].variety[0] = new Variety();
|
|
||||||
basket.fruit[0].variety[0].name = "red delicious";
|
|
||||||
basket.fruit[0].variety[1] = new Variety();
|
|
||||||
basket.fruit[0].variety[1].name = "granny smith";
|
|
||||||
|
|
||||||
basket.fruit[1] = new Fruit();
|
|
||||||
basket.fruit[1].name = "banana";
|
|
||||||
basket.fruit[1].variety = new Variety[1];
|
|
||||||
basket.fruit[1].variety[0] = new Variety();
|
|
||||||
basket.fruit[1].variety[0].name = "plantain";
|
|
||||||
|
|
||||||
String expected = "[[fruit]]\n" +
|
|
||||||
"name = \"apple\"\n" +
|
|
||||||
"\n" +
|
|
||||||
"[fruit.physical]\n" +
|
|
||||||
"color = \"red\"\n" +
|
|
||||||
"shape = \"round\"\n" +
|
|
||||||
"\n" +
|
|
||||||
"[[fruit.variety]]\n" +
|
|
||||||
"name = \"red delicious\"\n" +
|
|
||||||
"\n" +
|
|
||||||
"[[fruit.variety]]\n" +
|
|
||||||
"name = \"granny smith\"\n" +
|
|
||||||
"\n" +
|
|
||||||
"[[fruit]]\n" +
|
|
||||||
"name = \"banana\"\n" +
|
|
||||||
"\n" +
|
|
||||||
"[[fruit.variety]]\n" +
|
|
||||||
"name = \"plantain\"" +
|
|
||||||
"\n";
|
|
||||||
|
|
||||||
|
|
||||||
String output = new TomlWriter().write(basket);
|
|
||||||
assertEquals(expected, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void should_write_classes_with_inheritance() {
|
public void should_write_classes_with_inheritance() {
|
||||||
class Parent {
|
class Parent {
|
||||||
|
|
Loading…
Reference in a new issue