FidoPath extends AbstractFidoAddressesList { public static FidoPath valueOf(String addressesString, int defaultZone) { Set<FTNAddr> addresses = new LinkedHashSet<FTNAddr>(); return new FidoPath(parseAddresses(addressesString.trim(), defaultZone, addresses)); } FidoPath();  FidoPath(Set<FTNAddr> addresses); static FidoPath valueOf(String addressesString, int defaultZone); String toPathString(); String[] toPathStrings(); static final String PATH_LINE_PREFIX; }
@Test public void testPathFromString() { String pathString = "5020/545 4441 1042 5030/100 102 5040/102 5050/103"; FidoPath expectedPath = new FidoPath(); expectedPath.add(FTNAddr.valueOf("2:5020/545")); expectedPath.add(FTNAddr.valueOf("2:5020/4441")); expectedPath.add(FTNAddr.valueOf("2:5020/1042")); expectedPath.add(FTNAddr.valueOf("2:5030/100")); expectedPath.add(FTNAddr.valueOf("2:5030/102")); expectedPath.add(FTNAddr.valueOf("2:5040/102")); expectedPath.add(FTNAddr.valueOf("2:5050/103")); FidoPath actualPath = FidoPath.valueOf(pathString, 2); TestCase.assertEquals(expectedPath, actualPath); }
@Test public void testPathToString() { String pathString = "5020/545 4441 1042 5030/100 102 5040/102 5050/103"; FidoPath actualPath = new FidoPath(); actualPath.add(FTNAddr.valueOf("2:5020/545")); actualPath.add(FTNAddr.valueOf("2:5020/4441")); actualPath.add(FTNAddr.valueOf("2:5020/1042")); actualPath.add(FTNAddr.valueOf("2:5030/100")); actualPath.add(FTNAddr.valueOf("2:5030/102")); actualPath.add(FTNAddr.valueOf("2:5040/102")); actualPath.add(FTNAddr.valueOf("2:5050/103")); TestCase.assertEquals(pathString, actualPath.toString()); }