25-FixTypos

This commit is contained in:
Adrian-Devries 2025-04-24 12:54:11 +02:00
parent 7d99b83e07
commit 2466f9cf5d
50 changed files with 136 additions and 136 deletions

View file

@ -58,8 +58,8 @@ public class InputFactoryTest {
@Test
public void testDefaultDigestAlgorithm() {
assertThat(new InputFactory().getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITH);
assertThat(new InputFactory("").getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITH);
assertThat(new InputFactory().getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITHM);
assertThat(new InputFactory("").getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITHM);
}
@Test
@ -156,7 +156,7 @@ public class InputFactoryTest {
}
@Test
public void testUnexistingInput() {
public void testNotExistingInput() {
assertThrows(IllegalArgumentException.class, () -> InputFactory.read(Simple.NOT_EXISTING));
}

View file

@ -178,7 +178,7 @@ public class CommandlineApplicationTest {
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(CommandLine.getOutputLines()).haveAtLeastOne(new Condition<>(
s -> StringUtils.contains(s, "<?xml version=\"1.0\" " + "encoding=\"UTF-8\"?>"), "Must " + "contain xml preambel"));
s -> StringUtils.contains(s, "<?xml version=\"1.0\" " + "encoding=\"UTF-8\"?>"), "Must " + "contain xml preamble"));
}
@Test

View file

@ -64,7 +64,7 @@ public class DefaultNamingStrategyTest {
}
@Test
public void testUnknownExtenson() {
public void testUnknownExtension() {
final DefaultNamingStrategy strategy = new DefaultNamingStrategy();
assertThat(strategy.createName("test.ext")).isEqualTo("test.ext-report.xml");
strategy.setPrefix("prefix");

View file

@ -35,7 +35,7 @@ import java.util.stream.Stream;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Testet die HTML-Extrkation des Kommondazeilenprogramms.
* Testet die HTML-Extraktion des Kommandozeilenprogramms.
*
* @author Andreas Penski
*/

View file

@ -84,7 +84,7 @@ public class ConversionServiceTest {
@Test
public void testUnmarshalIllFormed() {
assertThrows(ConversionService.ConversionException.class,
() -> this.service.readXml(Invalid.SCENARIOS_ILLFORMED, Scenarios.class, this.repository.createSchema(SCHEMA)));
() -> this.service.readXml(Invalid.SCENARIOS_ILL_FORMED, Scenarios.class, this.repository.createSchema(SCHEMA)));
}
@Test

View file

@ -144,7 +144,7 @@ public class DefaultCheckTest {
public void testGarbage() {
final Result result = this.validCheck.checkInput(read(GARBAGE));
assertThat(result).isNotNull();
assertThat(result.isWellformed()).isFalse();
assertThat(result.isWellFormed()).isFalse();
assertThat(result.isSchemaValid()).isFalse();
assertThat(result.isProcessingSuccessful()).isFalse();
}
@ -153,7 +153,7 @@ public class DefaultCheckTest {
public void testNoScenario() {
final Result result = this.validCheck.checkInput(read(UNKNOWN));
assertThat(result).isNotNull();
assertThat(result.isWellformed()).isTrue();
assertThat(result.isWellFormed()).isTrue();
assertThat(result.isProcessingSuccessful()).isTrue();
assertThat(result.isSchemaValid()).isFalse();
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT);
@ -162,9 +162,9 @@ public class DefaultCheckTest {
@Test
public void testNotWellFormed() {
final Result result = this.validCheck.checkInput(read(NOT_WELLFORMED));
final Result result = this.validCheck.checkInput(read(NOT_WELL_FORMED));
assertThat(result).isNotNull();
assertThat(result.isWellformed()).isFalse();
assertThat(result.isWellFormed()).isFalse();
assertThat(result.isSchemaValid()).isFalse();
assertThat(result.isProcessingSuccessful()).isFalse();
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT);
@ -176,7 +176,7 @@ public class DefaultCheckTest {
public void testRejectAcceptMatch() {
final Result result = this.validCheck.checkInput(read(REJECTED));
assertThat(result).isNotNull();
assertThat(result.isWellformed()).isTrue();
assertThat(result.isWellFormed()).isTrue();
assertThat(result.isSchemaValid()).isTrue();
assertThat(result.isProcessingSuccessful()).isTrue();
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT);
@ -189,13 +189,13 @@ public class DefaultCheckTest {
public void testSchematronFailed() {
final Result result = this.validCheck.checkInput(read(SCHEMATRON_INVALID));
assertThat(result).isNotNull();
assertThat(result.isWellformed()).isTrue();
assertThat(result.isWellFormed()).isTrue();
assertThat(result.isSchemaValid()).isTrue();
assertThat(result.getFailedAsserts()).isNotEmpty();
assertThat(result.isSchematronValid()).isFalse();
assertThat(result.getSchematronResult().get(0).findFailedAssert("content-1")).isPresent();
assertThat(result.isProcessingSuccessful()).isTrue();
// acceptMatch overules schematron!!!
// acceptMatch overrules schematron!!!
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
assertThat(result.isAcceptable()).isTrue();
assertThat(result.getReport()).isNotNull();
@ -207,7 +207,7 @@ public class DefaultCheckTest {
public void testSchematronFailedWithoutAcceptMatch() {
final Result result = this.validCheck.checkInput(read(FOO_SCHEMATRON_INVALID));
assertThat(result).isNotNull();
assertThat(result.isWellformed()).isTrue();
assertThat(result.isWellFormed()).isTrue();
assertThat(result.isSchemaValid()).isTrue();
result.getFailedAsserts();
assertThat(result.isSchematronValid()).isFalse();

View file

@ -70,7 +70,7 @@ public class Helper {
public static final URI SCHEMATRON_INVALID = ROOT.resolve("input/simple-schematron-invalid.xml");
public static final URI NOT_WELLFORMED = ROOT.resolve("input/simple-not-wellformed.xml");
public static final URI NOT_WELL_FORMED = ROOT.resolve("input/simple-not-wellformed.xml");
public static final URI UNKNOWN = ROOT.resolve("input/unknown.xml");
@ -95,11 +95,11 @@ public class Helper {
public static class Invalid {
public static final URI ROOT = EXAMPLES_DIR.resolve("invaid/");
public static final URI ROOT = EXAMPLES_DIR.resolve("invalid/");
public static final URI SCENARIOS = ROOT.resolve("scenarios.xml");
public static final URI SCENARIOS_ILLFORMED = ROOT.resolve("scenarios-illformed.xml");
public static final URI SCENARIOS_ILL_FORMED = ROOT.resolve("scenarios-illformed.xml");
}

View file

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class ComputeAcceptanceActionTest {
private static final String DOESNOT_EXIST = "count(//doesnotExist) = 0";
private static final String DOES_NOT_EXIST = "count(//doesnotExist) = 0";
private final ComputeAcceptanceAction action = new ComputeAcceptanceAction();
@ -66,7 +66,7 @@ public class ComputeAcceptanceActionTest {
@Test
public void testValidAcceptMatch() {
final Bag bag = createBag(true, true);
bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOESNOT_EXIST));
bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOES_NOT_EXIST));
this.action.check(bag);
assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
}
@ -82,7 +82,7 @@ public class ComputeAcceptanceActionTest {
@Test
public void testAcceptMatchOverridesSchematronErrors() {
final Bag bag = createBag(true, false);
bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOESNOT_EXIST));
bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOES_NOT_EXIST));
this.action.check(bag);
assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
}
@ -90,7 +90,7 @@ public class ComputeAcceptanceActionTest {
@Test
public void testValidAcceptMatchOnSchemaFailed() {
final Bag bag = createBag(false, true);
bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOESNOT_EXIST));
bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOES_NOT_EXIST));
this.action.check(bag);
assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.REJECT);
}

View file

@ -52,8 +52,8 @@ public class DocumentParseActionTest {
}
@Test
public void testIllformed() {
final Result<XdmNode, XMLSyntaxError> result = this.action.parseDocument(read(Simple.NOT_WELLFORMED));
public void testIllFormed() {
final Result<XdmNode, XMLSyntaxError> result = this.action.parseDocument(read(Simple.NOT_WELL_FORMED));
assertThat(result).isNotNull();
assertThat(result.getErrors()).isNotEmpty();
assertThat(result.getObject()).isNull();

View file

@ -89,7 +89,7 @@ public class SchemaValidatorActionTest {
public void testNoRepeatableRead() throws Exception {
try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream() ) {
final Bag bag = createBag(InputFactory.read(new StreamSource(inputStream)));
// don't read the real inputstream here!
// don't read the real input stream here!
bag.setParserResult(Helper.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL())));
this.service.check(bag);
assertThat(bag.getSchemaValidationResult()).isNotNull();

View file

@ -68,18 +68,18 @@ public class TestBagBuilder {
return bag;
}
private static Scenario createScenario(final URI schemafile) {
private static Scenario createScenario(final URI schemaFile) {
try {
final ScenarioType t = new ScenarioType();
final ValidateWithXmlSchema v = new ValidateWithXmlSchema();
final ResourceType r = new ResourceType();
r.setLocation(schemafile.getRawPath());
r.setLocation(schemaFile.getRawPath());
r.setName("invoice");
v.getResource().add(r);
t.setValidateWithXmlSchema(v);
final Scenario scenario = new Scenario(t);
scenario.setSchema(createSchema(schemafile.toURL()));
scenario.setSchema(createSchema(schemaFile.toURL()));
final ResolvingConfigurationStrategy strategy = ResolvingMode.STRICT_RELATIVE.getStrategy();
scenario.setFactory(strategy);
return scenario;