Package org.jsoup.select

Examples of org.jsoup.select.Elements.attr()


        assertThat(selectElement.attr("id"), equalTo(oneToManyProperty));
        assertThat(selectElement.attr("multiple"), notNullValue());
        assertThat(selectElement.attr("ng-model"), equalTo(oneToManyProperty+"Selection"));
        String collectionElement = oneToManyProperty.substring(0, 1);
        String optionsExpression = collectionElement +".text for "+ collectionElement +" in " + oneToManyProperty + "SelectionList";
        assertThat(selectElement.attr("ng-options"), equalTo(optionsExpression));
    }
   
    @Test
    public void testGenerateManyToManyProperty() throws Exception {
        String manyToManyProperty = "users";
View Full Code Here


                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
        Elements link = doc.select("link[href]");
        String attr = link.attr("href");
        assertThat(attr, is("./mycustom.css"));

    }

    @Test
View Full Code Here

                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
        Elements link = doc.select("link[href]");
        String attr = link.attr("href");
        assertThat(attr, is(""));

    }

    @Test
View Full Code Here

                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
        Elements link = doc.select("link[href]");
        String attr = link.attr("href");
        assertThat(attr, is("./styles/mycustom.css"));

    }

    @Test
View Full Code Here

        String renderContent = asciidoctor.render(toString(content), options);

        Document doc = Jsoup.parse(renderContent, "UTF-8");
        Elements image = doc.select("img[src]");
        String srcValue = image.attr("src");
        assertThat(srcValue, is("icons/note.png"));

    }

    @Test
View Full Code Here

                "http://google.com[Google, window=\"_blank\"]", options);

        Document doc = Jsoup.parse(content);
        Elements image = doc.select("a[target]");

        String targetValue = image.attr("target");
        assertThat(targetValue, is("_blank"));

    }

    @Test
View Full Code Here

                "target/test-classes/toc2sample.asciidoc"), options);

        File renderedFile = new File(testFolder.getRoot(), "toc2sample.html");
        Document doc = Jsoup.parse(renderedFile, "UTF-8");
        Elements body = doc.select("body");
        String classAttribute = body.attr("class");
        String[] classAttributes = classAttribute.split(" ");
        assertThat(classAttributes, hasItemInArray("toc2"));
        assertThat(classAttributes, hasItemInArray("toc-right"));

        renderedFile.delete();
View Full Code Here

                "target/test-classes/toc2sample.asciidoc"), options);

        File renderedFile = new File(testFolder.getRoot(), "toc2sample.html");
        Document doc = Jsoup.parse(renderedFile, "UTF-8");
        Elements body = doc.select("body");
        String classAttribute = body.attr("class");
        String[] classAttributes = classAttribute.split(" ");
        assertThat(classAttributes, hasItemInArray("toc2"));
        assertThat(classAttributes, hasItemInArray("toc-right"));

        renderedFile.delete();
View Full Code Here

    new AsciidoctorInvoker().invoke("-a", "stylesheet=mystyles.css", "-a", "linkcss", "target/test-classes/rendersample.asciidoc");
    File expectedFile = new File("target/test-classes/rendersample.html");
   
    Document doc = Jsoup.parse(expectedFile, "UTF-8");
    Elements link = doc.select("link[href]");
    String attr = link.attr("href");
    assertThat(attr, is("./mystyles.css"));
   
    expectedFile.delete();
   
  }
View Full Code Here

   
    Document doc = Jsoup.parse(output.toString(), "UTF-8");

    Elements link = doc.select("div[class]");
   
    String attr = link.attr("class");
    assertThat(attr, is("sect1"));
   
  }
 
  @Test
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.