Sfoglia il codice sorgente

SONAR-10725 stabilize version of jsoup dependency

tags/7.8
Sébastien Lesaint 5 anni fa
parent
commit
c58d901db8

+ 2
- 1
build.gradle Vedi File

@@ -211,6 +211,7 @@ subprojects {
dependency('org.codelibs.elasticsearch.module:analysis-common:6.6.1')
dependency 'org.freemarker:freemarker:2.3.20'
dependency 'org.hamcrest:hamcrest-all:1.3'
dependency 'org.jsoup:jsoup:1.11.3'
dependency 'org.mindrot:jbcrypt:0.4'
dependency('org.mockito:mockito-core:2.15.0') {
exclude 'org.hamcrest:hamcrest-core'
@@ -230,7 +231,7 @@ subprojects {
dependency 'org.sonarsource.orchestrator:sonar-orchestrator:3.24.0.1993'
dependency 'org.sonarsource.update-center:sonar-update-center-common:1.18.0.487'
dependency 'org.subethamail:subethasmtp:3.1.7'
dependency 'xml-apis:xml-apis:1.4.01'
dependency 'xml-apis:xml-apis:1.4.01'

// please keep this list alphabetically ordered
}

+ 1
- 1
sonar-testing-harness/build.gradle Vedi File

@@ -14,7 +14,7 @@ dependencies {
compile 'junit:junit'
compile 'org.assertj:assertj-core'
compile 'org.hamcrest:hamcrest-all'
compile 'org.jsoup:jsoup:1.11.3'
compile 'org.jsoup:jsoup'

compileOnly 'com.google.code.findbugs:jsr305'


+ 15
- 6
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlListAssert.java Vedi File

@@ -89,15 +89,25 @@ public class HtmlListAssert extends HtmlBlockAssert<HtmlListAssert> {
}

/**
* Convenience method.
* Sames as {@code hasParagraph().withText("")}.
* Verifies next paragraph is empty or contains only "&nbsp;"
*/
public HtmlParagraphAssert hasEmptyParagraph() {
return hasParagraph()
.withText("");
Element paragraph = hasParagraphImpl();

Assertions.assertThat(paragraph.text())
.describedAs(PRINT_FRAGMENT_TEMPLATE, paragraph)
.isIn("", "\u00A0");

return new HtmlParagraphAssert(paragraph, nextBlocks);
}

public HtmlParagraphAssert hasParagraph() {
Element element = hasParagraphImpl();

return new HtmlParagraphAssert(element, nextBlocks);
}

private Element hasParagraphImpl() {
isNotNull();

Assertions.assertThat(nextBlocks.hasNext())
@@ -106,8 +116,7 @@ public class HtmlListAssert extends HtmlBlockAssert<HtmlListAssert> {

Element element = nextBlocks.next();
HtmlParagraphAssert.verifyIsParagraph(element);

return new HtmlParagraphAssert(element, nextBlocks);
return element;
}

/**

+ 13
- 6
sonar-testing-harness/src/main/java/org/sonar/test/html/HtmlParagraphAssert.java Vedi File

@@ -52,6 +52,10 @@ public class HtmlParagraphAssert extends HtmlBlockAssert<HtmlParagraphAssert> {
* Verify the next block exists, is a paragraph and returns an Assert on this block.
*/
public HtmlParagraphAssert hasParagraph() {
return new HtmlParagraphAssert(hasParagraphImpl(), nextBlocks);
}

private Element hasParagraphImpl() {
isNotNull();

Assertions.assertThat(nextBlocks.hasNext())
@@ -60,8 +64,7 @@ public class HtmlParagraphAssert extends HtmlBlockAssert<HtmlParagraphAssert> {

Element element = nextBlocks.next();
verifyIsParagraph(element);

return new HtmlParagraphAssert(element, nextBlocks);
return element;
}

/**
@@ -74,12 +77,16 @@ public class HtmlParagraphAssert extends HtmlBlockAssert<HtmlParagraphAssert> {
}

/**
* Convenience method.
* Sames as {@code hasParagraph().withText("")}.
* Verifies next paragraph is empty or contains only "&nbsp;"
*/
public HtmlParagraphAssert hasEmptyParagraph() {
return hasParagraph()
.withText("");
Element paragraph = hasParagraphImpl();

Assertions.assertThat(paragraph.text())
.describedAs(PRINT_FRAGMENT_TEMPLATE, paragraph)
.isIn("", "\u00A0");

return new HtmlParagraphAssert(paragraph, nextBlocks);
}

/**

Loading…
Annulla
Salva