Package org.jsoup.nodes

Examples of org.jsoup.nodes.Document.text()


      if (htmlString != null) {
        Document documentFragment = Jsoup.parseBodyFragment(htmlString);
        result = retrieveContent(documentFragment);

        if (result.equals("")) {
          String fragmentText = documentFragment.text();
          if (fragmentText != null) {
            result = fragmentText;
          }
        }
      }
View Full Code Here


        thumb = elements.get(0).attr("src");
      }
      obj.setThumb(thumb);

      // tag
      String strTag = StringHelper.keyword(doc.text());
      try {
        ArrayList<String> listTag = new ArrayList<String>();
        String[] splitTag = strTag.split(",");
        for (String string : splitTag) {
          String tagAlias = StringHelper.replaceVietnamese(string
View Full Code Here

                .andExpect(content().contentTypeCompatibleWith("text/html"))
                .andReturn();

        Document document = Jsoup.parse(mvcResult.getResponse().getContentAsString());
        assertThat(document.select("h1").text(), containsString("Eclipse"));
        assertThat(document.text(), containsString("Spring Tool Suite"));
        assertThat(document.text(), containsString("Groovy/Grails Tool Suite"));
        assertThat(document.text(), containsString("Windows"));
    }

    @Test
View Full Code Here

                .andReturn();

        Document document = Jsoup.parse(mvcResult.getResponse().getContentAsString());
        assertThat(document.select("h1").text(), containsString("Eclipse"));
        assertThat(document.text(), containsString("Spring Tool Suite"));
        assertThat(document.text(), containsString("Groovy/Grails Tool Suite"));
        assertThat(document.text(), containsString("Windows"));
    }

    @Test
    public void showsStsWelcome() throws Exception {
View Full Code Here

        Document document = Jsoup.parse(mvcResult.getResponse().getContentAsString());
        assertThat(document.select("h1").text(), containsString("Eclipse"));
        assertThat(document.text(), containsString("Spring Tool Suite"));
        assertThat(document.text(), containsString("Groovy/Grails Tool Suite"));
        assertThat(document.text(), containsString("Windows"));
    }

    @Test
    public void showsStsWelcome() throws Exception {
        mockMvc.perform(get("/tools/sts/welcome?version=3.2.0.RELEASE&os=macosx.cocoa.x86_64"))
View Full Code Here

                .andExpect(content().contentTypeCompatibleWith("text/html"))
                .andReturn();

        Document html = Jsoup.parse(response.getResponse().getContentAsString());
        assertThat(html.select("ul li.active").text(), equalTo("Guides"));
        Assert.assertThat(html.text(), containsString("Building a RESTful Web Service"));
        Assert.assertThat(html.text(), containsString("Learn how to create a RESTful web service with Spring"));
        Assert.assertThat(html.text(), containsString("Designing and Implementing RESTful Web Services with Spring"));
        Assert.assertThat(html.text(),
                containsString("Learn how to design and implement RESTful web services with Spring"));
    }
View Full Code Here

                .andReturn();

        Document html = Jsoup.parse(response.getResponse().getContentAsString());
        assertThat(html.select("ul li.active").text(), equalTo("Guides"));
        Assert.assertThat(html.text(), containsString("Building a RESTful Web Service"));
        Assert.assertThat(html.text(), containsString("Learn how to create a RESTful web service with Spring"));
        Assert.assertThat(html.text(), containsString("Designing and Implementing RESTful Web Services with Spring"));
        Assert.assertThat(html.text(),
                containsString("Learn how to design and implement RESTful web services with Spring"));
    }
View Full Code Here

        Document html = Jsoup.parse(response.getResponse().getContentAsString());
        assertThat(html.select("ul li.active").text(), equalTo("Guides"));
        Assert.assertThat(html.text(), containsString("Building a RESTful Web Service"));
        Assert.assertThat(html.text(), containsString("Learn how to create a RESTful web service with Spring"));
        Assert.assertThat(html.text(), containsString("Designing and Implementing RESTful Web Services with Spring"));
        Assert.assertThat(html.text(),
                containsString("Learn how to design and implement RESTful web services with Spring"));
    }

}
View Full Code Here

        Document html = Jsoup.parse(response.getResponse().getContentAsString());
        assertThat(html.select("ul li.active").text(), equalTo("Guides"));
        Assert.assertThat(html.text(), containsString("Building a RESTful Web Service"));
        Assert.assertThat(html.text(), containsString("Learn how to create a RESTful web service with Spring"));
        Assert.assertThat(html.text(), containsString("Designing and Implementing RESTful Web Services with Spring"));
        Assert.assertThat(html.text(),
                containsString("Learn how to design and implement RESTful web services with Spring"));
    }

}
View Full Code Here

        postRepository.save(post);

        MvcResult response = mockMvc.perform(get("/blog")).andReturn();
        Document html = Jsoup.parse(response.getResponse().getContentAsString());
        assertTrue(html.select("a.author").isEmpty());
        assertThat(html.text(), containsString("Hidden Author"));
    }

    @Test
    public void blogPostPageIncludesLinkToAuthor() throws Exception {
        MemberProfile activeAuthor = MemberProfileBuilder.profile().username("active_author").build();
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.