@Test public void testAclToken() { AclToken token = randomAclToken(); checkAclToken(token, new AclToken(token)); checkAclToken(token, new AclToken(token.toJson())); }
@Test public void testCheckCopy() { Check check = randomCheck(); checkCheck(check, new Check(check)); checkCheck(check, new Check(check.toJson())); }
@Test public void testCoordinateCopy() { Coordinate coordinate = randomCoordinate(); checkCoordinate(coordinate, new Coordinate(coordinate)); checkCoordinate(coordinate, new Coordinate(coordinate.toJson())); }
@Test public void testEventCopy() { Event event = randomEvent(); checkEvent(event, new Event(event)); checkEvent(event, new Event(event.toJson())); }
@Test public void testKeyValueCopy() { KeyValue kv = randomKeyValue(); checkKeyValue(kv, new KeyValue(kv)); checkKeyValue(kv, new KeyValue(kv.toJson())); }
@Test public void testCoordinateListCopy() { List<Coordinate> list = new ArrayList<>(); list.add(randomCoordinate()); list.add(randomCoordinate()); CoordinateList coordinateList = new CoordinateList() .setList(list) .setIndex(randomLong()); checkCoordinateList(coordinateList, new CoordinateList(coordinateList)); checkCoordinateList(coordinateList, new CoordinateList(coordinateList.toJson())); List<Coordinate> shuffled = new ArrayList<>(); shuffled.add(list.get(1)); shuffled.add(list.get(0)); CoordinateList coordsShuffled = new CoordinateList() .setList(shuffled) .setIndex(coordinateList.getIndex()); checkCoordinateList(coordinateList, coordsShuffled); }
@Test public void testKeyValueListCopy() { List<KeyValue> list = new ArrayList<>(); list.add(randomKeyValue()); list.add(randomKeyValue()); KeyValueList kvList = new KeyValueList() .setList(list) .setIndex(randomLong()); checkKeyValueList(kvList, new KeyValueList(kvList)); checkKeyValueList(kvList, new KeyValueList(kvList.toJson())); List<KeyValue> shuffled = new ArrayList<>(); shuffled.add(list.get(1)); shuffled.add(list.get(0)); KeyValueList kvShuffled = new KeyValueList() .setList(shuffled) .setIndex(kvList.getIndex()); checkKeyValueList(kvList, kvShuffled); }
@Test public void testEventListCopy() { List<Event> events = new ArrayList<>(); events.add(randomEvent()); events.add(randomEvent()); EventList list = new EventList() .setIndex(randomPositiveInt()) .setList(events); checkEventList(list, new EventList(list)); checkEventList(list, new EventList(list.toJson())); List<Event> shuffledEvents = new ArrayList<>(); shuffledEvents.add(events.get(1)); shuffledEvents.add(events.get(0)); EventList shuffled = new EventList() .setIndex(list.getIndex()) .setList(shuffledEvents); checkEventList(list, shuffled); }
@Test public void testCheckListCopy() { List<Check> checks = new ArrayList<>(); checks.add(randomCheck()); checks.add(randomCheck()); CheckList list = new CheckList() .setIndex(randomPositiveInt()) .setList(checks); checkCheckList(list, new CheckList(list)); checkCheckList(list, new CheckList(list.toJson())); List<Check> shuffledEvents = new ArrayList<>(); shuffledEvents.add(checks.get(1)); shuffledEvents.add(checks.get(0)); CheckList shuffled = new CheckList() .setIndex(list.getIndex()) .setList(shuffledEvents); checkCheckList(list, shuffled); }