/** * Private helper function to encode the attribute sets */ private void encodeAttributes(List attributes, PrintStream out, Indenter indenter) { Iterator it = attributes.iterator(); while (it.hasNext()) { Attribute attr = (Attribute)(it.next()); attr.encode(out, indenter); } }
/** * Private helper function to encode the attribute sets */ private void encodeAttributes(List attributes, PrintStream out, Indenter indenter) { Iterator it = attributes.iterator(); while (it.hasNext()) { Attribute attr = (Attribute)(it.next()); attr.encode(out, indenter); } }
@Test public void testSingletonRoundtrip() throws ParsingException { URI id = URI.create("lol:wut"); String issuer = null; Attribute expected = new SingletonAttribute(id, issuer, null, StringAttribute.getInstance("foo")); String encoded = expected.encode(); ByteArrayInputStream input = new ByteArrayInputStream(encoded.getBytes()); Attribute actual = BasicAttribute.getInstance(InputParser.parseInput(input, "Attribute")); assertEquals(expected, actual); } // Supports legacy test runners