Added soft assertions
This commit is contained in:
parent
0983f323a2
commit
d797c515bb
2 changed files with 51 additions and 38 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
package rife.bld.extension;
|
||||
|
||||
import org.assertj.core.api.AutoCloseableSoftAssertions;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import rife.bld.blueprints.BaseProjectBlueprint;
|
||||
|
@ -107,14 +108,17 @@ class DokkaOperationTest {
|
|||
)))
|
||||
.suppressInheritedMembers(true);
|
||||
|
||||
assertThat(op.globalLinks()).as("globalLinks").hasSize(2);
|
||||
assertThat(op.globalPackageOptions()).as("globalPackageOptions").hasSize(4);
|
||||
assertThat(op.globalSrcLink()).as("globalSrcLink").hasSize(4);
|
||||
assertThat(op.includes()).as("includes").hasSize(4);
|
||||
assertThat(op.pluginConfigurations()).as("pluginConfigurations").hasSize(3);
|
||||
assertThat(op.pluginsClasspath()).as("pluginsClasspath").hasSize(9);
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
softly.assertThat(op.globalLinks()).as("globalLinks").hasSize(2);
|
||||
softly.assertThat(op.globalPackageOptions()).as("globalPackageOptions").hasSize(4);
|
||||
softly.assertThat(op.globalSrcLink()).as("globalSrcLink").hasSize(4);
|
||||
softly.assertThat(op.includes()).as("includes").hasSize(4);
|
||||
softly.assertThat(op.pluginConfigurations()).as("pluginConfigurations").hasSize(3);
|
||||
softly.assertThat(op.pluginsClasspath()).as("pluginsClasspath").hasSize(9);
|
||||
}
|
||||
|
||||
var params = op.executeConstructProcessCommandList();
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
for (var p : args) {
|
||||
var found = false;
|
||||
for (var a : params) {
|
||||
|
@ -123,7 +127,8 @@ class DokkaOperationTest {
|
|||
break;
|
||||
}
|
||||
}
|
||||
assertThat(found).as(p + " not found.").isTrue();
|
||||
softly.assertThat(found).as(p + " not found.").isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
var path = EXAMPLES.getAbsolutePath();
|
||||
|
@ -157,15 +162,18 @@ class DokkaOperationTest {
|
|||
|
||||
assertThat(params).hasSize(matches.size());
|
||||
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
IntStream.range(0, params.size()).forEach(i -> {
|
||||
if (params.get(i).contains(".jar;")) {
|
||||
var jars = params.get(i).split(";");
|
||||
Arrays.stream(jars).forEach(jar -> assertThat(matches.get(i)).as(matches.get(i)).contains(jar));
|
||||
Arrays.stream(jars).forEach(jar ->
|
||||
softly.assertThat(matches.get(i)).as(matches.get(i)).contains(jar));
|
||||
} else {
|
||||
assertThat(params.get(i)).as(params.get(i)).isEqualTo(matches.get(i));
|
||||
softly.assertThat(params.get(i)).as(params.get(i)).isEqualTo(matches.get(i));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void executeNoProjectTest() {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package rife.bld.extension.dokka;
|
||||
|
||||
import org.assertj.core.api.AutoCloseableSoftAssertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -225,19 +226,22 @@ class SourceSetTest {
|
|||
.srcLink(Path.of(PATH_3), "remote3", "#suffix3")
|
||||
.suppressedFiles(SUP_1, SUP_2);
|
||||
|
||||
assertThat(sourceSet.classpath()).as("classpath").hasSize(2);
|
||||
assertThat(sourceSet.dependentSourceSets()).as("dependentSourceSets").hasSize(2);
|
||||
assertThat(sourceSet.documentedVisibilities()).as("documentedVisibilities").hasSize(2);
|
||||
assertThat(sourceSet.externalDocumentationLinks()).as("externalDocumentationLinks").hasSize(2);
|
||||
assertThat(sourceSet.includes()).as("includes").hasSize(4);
|
||||
assertThat(sourceSet.perPackageOptions()).as("perPackageOptions").hasSize(2);
|
||||
assertThat(sourceSet.samples()).as("samples").hasSize(2);
|
||||
assertThat(sourceSet.src()).as("src").hasSize(4);
|
||||
assertThat(sourceSet.srcLinks()).as("srcLinks").hasSize(3);
|
||||
assertThat(sourceSet.suppressedFiles()).as("suppressedFiles").hasSize(2);
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
softly.assertThat(sourceSet.classpath()).as("classpath").hasSize(2);
|
||||
softly.assertThat(sourceSet.dependentSourceSets()).as("dependentSourceSets").hasSize(2);
|
||||
softly.assertThat(sourceSet.documentedVisibilities()).as("documentedVisibilities").hasSize(2);
|
||||
softly.assertThat(sourceSet.externalDocumentationLinks()).as("externalDocumentationLinks").hasSize(2);
|
||||
softly.assertThat(sourceSet.includes()).as("includes").hasSize(4);
|
||||
softly.assertThat(sourceSet.perPackageOptions()).as("perPackageOptions").hasSize(2);
|
||||
softly.assertThat(sourceSet.samples()).as("samples").hasSize(2);
|
||||
softly.assertThat(sourceSet.src()).as("src").hasSize(4);
|
||||
softly.assertThat(sourceSet.srcLinks()).as("srcLinks").hasSize(3);
|
||||
softly.assertThat(sourceSet.suppressedFiles()).as("suppressedFiles").hasSize(2);
|
||||
}
|
||||
|
||||
var params = sourceSet.args();
|
||||
|
||||
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||
for (var p : args) {
|
||||
var found = false;
|
||||
for (var a : params) {
|
||||
|
@ -246,7 +250,8 @@ class SourceSetTest {
|
|||
break;
|
||||
}
|
||||
}
|
||||
assertThat(found).as(p + " not found.").isTrue();
|
||||
softly.assertThat(found).as(p + " not found.").isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
var matches = List.of(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue