Examples of replaceWith()


Examples of org.asynchttpclient.FluentStringsMap.replaceWith()

        assertEquals(map.get("foo"), Arrays.asList("bar"));
        assertEquals(map.getFirstValue("baz"), "foo");
        assertEquals(map.getJoinedValue("baz", ", "), "foo, bar");
        assertEquals(map.get("baz"), Arrays.asList("foo", "bar"));

        map.replaceWith("bar", Arrays.asList("blub"));

        assertEquals(map.keySet(), new LinkedHashSet<String>(Arrays.asList("foo", "baz", "bar")));
        assertEquals(map.getFirstValue("foo"), "bar");
        assertEquals(map.getJoinedValue("foo", ", "), "bar");
        assertEquals(map.get("foo"), Arrays.asList("bar"));
View Full Code Here

Examples of org.asynchttpclient.FluentStringsMap.replaceWith()

        assertEquals(map.get("foo"), Arrays.asList("bar"));
        assertEquals(map.getFirstValue("baz"), "foo");
        assertEquals(map.getJoinedValue("baz", ", "), "foo, bar");
        assertEquals(map.get("baz"), Arrays.asList("foo", "bar"));

        map.replaceWith(null, Arrays.asList("blub"));

        assertEquals(map.keySet(), new LinkedHashSet<String>(Arrays.asList("foo", "baz")));
        assertEquals(map.getFirstValue("foo"), "bar");
        assertEquals(map.getJoinedValue("foo", ", "), "bar");
        assertEquals(map.get("foo"), Arrays.asList("bar"));
View Full Code Here

Examples of org.asynchttpclient.FluentStringsMap.replaceWith()

        assertEquals(map.get("foo"), Arrays.asList("bar"));
        assertEquals(map.getFirstValue("baz"), "foo");
        assertEquals(map.getJoinedValue("baz", ", "), "foo, bar");
        assertEquals(map.get("baz"), Arrays.asList("foo", "bar"));

        map.replaceWith("baz", (Collection<String>) null);

        assertEquals(map.keySet(), new LinkedHashSet<String>(Arrays.asList("foo")));
        assertEquals(map.getFirstValue("foo"), "bar");
        assertEquals(map.getJoinedValue("foo", ", "), "bar");
        assertEquals(map.get("foo"), Arrays.asList("bar"));
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

    while (search.hasNext()) {
      TextSelection item = (TextSelection) search.nextSelection();
      table = sourcedoc.getTableByName("Table1");
      Cell cell = table.getCellByPosition(0, 0);
      cell.setStringValue("SIMPLE");
      Table newtable = item.replaceWith(table);
      Assert.assertNotNull(newtable);
      Assert.assertEquals(1, newtable.getHeaderColumnCount());
      Assert.assertEquals(1, newtable.getHeaderRowCount());
      Assert.assertEquals(7 + 1, newtable.getRowCount());
      Assert.assertEquals(5 + 1, newtable.getColumnCount());
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

    // Paragraph
    search = new TextNavigation("Task1", doc);
    while (search.hasNext()) {
      TextSelection item = (TextSelection) search.nextSelection();
      table = sourcedoc.getTableByName("Table2");
      Table newtable = item.replaceWith(table);
      Cell cell = newtable.getCellByPosition(0, 0);
      cell.setStringValue("From Source Table2");
      Assert.assertNotNull(newtable);
      Assert.assertEquals(1, newtable.getHeaderColumnCount());
      Assert.assertEquals(1, newtable.getHeaderRowCount());
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

    search = new TextNavigation("RESS%>", doc);
   
    while (search.hasNext()) {
      TextSelection item = (TextSelection) search.nextSelection();
      table = sourcedoc.getTableByName("Table3");
      Table newtable = item.replaceWith(table);
      Cell cell = newtable.getCellByPosition(0, 0);
      cell.setStringValue("From Source Table3");
      Assert.assertNotNull(newtable);
      Assert.assertEquals(5, newtable.getRowCount());
      Assert.assertEquals(3, newtable.getColumnCount());
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

    try {
      while (search.hasNext()) {
        i++;
        TextSelection item = (TextSelection) search.nextSelection();
        table = sourcedoc.getTableByName("Table1");
        Table newtable = item.replaceWith(table);
        Assert.assertNotNull(newtable);
        Assert.assertEquals(1, newtable.getHeaderColumnCount());
        Assert.assertEquals(1, newtable.getHeaderRowCount());
        Assert.assertEquals(7 + 1, newtable.getRowCount());
        Assert.assertEquals(5 + 1, newtable.getColumnCount());
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

      TextParagraphElementBase textParaEleBase = paragraph.getOdfElement();
      NodeList nodeImages = textParaEleBase.getElementsByTagName("draw:image");
      Node nodeImage = nodeImages.item(0);
      DrawImageElement im = (DrawImageElement) nodeImage;
      Image ima = Image.getInstanceof(im);
      image = item.replaceWith(ima);
      Assert.assertNotNull(image);
      if (image.getName().startsWith("replace")) {
        Assert.assertTrue(true);
      } else {
        Assert.fail();
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

    i = 0;
    try {
      while (search.hasNext()) {
        item = (TextSelection) search.nextSelection();
        URI imageuri = ResourceUtilities.getURI("image_list_item.png");
        image = item.replaceWith(imageuri);
        Assert.assertNotNull(image);
        if (image.getName().startsWith("replace")) {
          Assert.assertTrue(true);
        } else {
          Assert.fail();
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection.replaceWith()

    try {
      while (search.hasNext()) {
        i++;
        item = (TextSelection) search.nextSelection();
        URI imageuri = ResourceUtilities.getURI("image_list_item.png");
        image = item.replaceWith(imageuri);
        Assert.assertNotNull(image);
        if (image.getName().startsWith("replace")) {
          Assert.assertTrue(true);
        } else {
          Assert.fail();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.