示例#1
0
  /**
   * Tests characteristic round tripping
   *
   * @throws IOException
   */
  @Test
  public void characteristic_writable_01() throws IOException {
    Node n = NodeFactory.createURI("http://example.org");
    CharacteristicWritable expected = new CharacteristicWritable(n);
    Assert.assertEquals(1, expected.getCount().get());

    this.checkRoundTrip(expected);
  }
示例#2
0
 /**
  * Checks a characteristic set
  *
  * @param set Set
  * @param expectedItems Expected number of characteristics
  * @param expectedCounts Expected counts for characteristics
  */
 protected final void checkCharacteristicSet(
     CharacteristicSetWritable set, int expectedItems, long[] expectedCounts) {
   Assert.assertEquals(expectedItems, set.size());
   Assert.assertEquals(expectedItems, expectedCounts.length);
   Iterator<CharacteristicWritable> iter = set.getCharacteristics();
   int i = 0;
   while (iter.hasNext()) {
     CharacteristicWritable cw = iter.next();
     Assert.assertEquals(expectedCounts[i], cw.getCount().get());
     i++;
   }
 }