Improve memory effeciency (#22)

#20 Use s9api only for internal processing; 
Improve memory effeciency
This commit is contained in:
apenski 2019-02-13 08:19:02 +01:00 committed by GitHub
parent aacbce522b
commit 34d79d5e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 326 additions and 202 deletions

View file

@ -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());

View file

@ -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

View file

@ -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);

View file

@ -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();

View file

@ -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();