mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
Improve memory effeciency (#22)
#20 Use s9api only for internal processing; Improve memory effeciency
This commit is contained in:
parent
aacbce522b
commit
34d79d5e2c
26 changed files with 326 additions and 202 deletions
|
|
@ -66,7 +66,7 @@ public class CheckAssertionActionTest {
|
|||
@Test
|
||||
public void testSimple() throws URISyntaxException {
|
||||
final CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(SAMPLE), new CreateReportInput());
|
||||
bag.setReport(Helper.load(SAMPLE_REPORT).getObject());
|
||||
bag.setReport(Helper.load(SAMPLE_REPORT));
|
||||
|
||||
final Assertions assertions = Helper.load(SAMPLE_ASSERTIONS, Assertions.class);
|
||||
CheckAssertionAction a = new CheckAssertionAction(assertions, ObjectFactory.createProcessor());
|
||||
|
|
|
|||
|
|
@ -19,8 +19,14 @@
|
|||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static de.kosit.validationtool.impl.Helper.ASSERTIONS;
|
||||
import static de.kosit.validationtool.impl.Helper.NOT_EXISTING;
|
||||
import static de.kosit.validationtool.impl.Helper.REPOSITORY;
|
||||
import static de.kosit.validationtool.impl.Helper.SAMPLE;
|
||||
import static de.kosit.validationtool.impl.Helper.SAMPLE2;
|
||||
import static de.kosit.validationtool.impl.Helper.SAMPLE_DIR;
|
||||
import static de.kosit.validationtool.impl.Helper.SCENARIO_FILE;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
|
@ -28,8 +34,8 @@ import java.nio.file.Path;
|
|||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
import static de.kosit.validationtool.impl.Helper.*;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Testet die Parameter des Kommandozeilen-Tools.
|
||||
|
|
@ -146,7 +152,7 @@ public class CommandlineApplicationTest {
|
|||
Paths.get(SAMPLE).toString() };
|
||||
CommandLineApplication.mainProgram(args);
|
||||
assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
|
||||
assertThat(commandLine.getOutputLines()).contains("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
assertThat(commandLine.getOutputLines().get(0)).contains("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class ExtractHtmlActionTest {
|
|||
public void testSimple() throws IOException {
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT));
|
||||
assertThat(action.isSkipped(b)).isTrue();
|
||||
b.setReport(Helper.load(REPORT).getObject());
|
||||
b.setReport(Helper.load(REPORT));
|
||||
action.check(b);
|
||||
assertThat(action.isSkipped(b)).isFalse();
|
||||
action.check(b);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class PrintReportActionTest {
|
|||
@Test
|
||||
public void testSimpleSerialize() {
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT));
|
||||
b.setReport(Helper.load(REPORT).getObject());
|
||||
b.setReport(Helper.load(REPORT));
|
||||
assertThat(action.isSkipped(b)).isFalse();
|
||||
action.check(b);
|
||||
assertThat(b.isStopped()).isFalse();
|
||||
|
|
|
|||
|
|
@ -19,20 +19,21 @@
|
|||
|
||||
package de.kosit.validationtool.cmd;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.Helper;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import de.kosit.validationtool.api.InputFactory;
|
||||
import de.kosit.validationtool.impl.Helper;
|
||||
import de.kosit.validationtool.impl.tasks.CheckAction;
|
||||
|
||||
/**
|
||||
* @author Andreas Penski
|
||||
|
|
@ -60,7 +61,7 @@ public class SerializeReportActionTest {
|
|||
public void testSimpleSerialize() {
|
||||
CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT));
|
||||
assertThat(action.isSkipped(b)).isTrue();
|
||||
b.setReport(Helper.load(REPORT).getObject());
|
||||
b.setReport(Helper.load(REPORT));
|
||||
assertThat(action.isSkipped(b)).isFalse();
|
||||
action.check(b);
|
||||
assertThat(b.isStopped()).isFalse();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue