コード例 #1
0
  public void testGetTuples() {
    ConverterTuple[] initialTuples = prepareTuples();
    ConverterTuple[] expectedTuples =
        new ConverterTuple[] {new ConverterTuple(null, "link", "href")};

    ConverterConfiguration configuration = new ConverterConfiguration(initialTuples);
    ConverterTuple[] received = configuration.getTuples(null, "link");
    assertTrue(areTuplesArrayEquals(expectedTuples, received));
  }
コード例 #2
0
  public void testPutTuples() {
    ConverterTuple[] initialTuples = prepareTuples();
    ConverterTuple[] expectedTuples =
        new ConverterTuple[] {new ConverterTuple(null, "link", "href")};

    ConverterConfiguration configuration = new ConverterConfiguration();
    configuration.putTuplesByMode("html", initialTuples);
    ConverterTuple[] received = configuration.getTuplesByMode(null, "link", "html");
    assertNotNull(received);
    assertTrue(areTuplesArrayEquals(expectedTuples, received));
    ConverterTuple[] receivedBad = configuration.getTuplesByMode(null, "link", "xdime");
    assertNull(receivedBad);
  }