unit test refactoring
This commit is contained in:
parent
ee211b8a3c
commit
1ac264acc0
|
@ -15,15 +15,7 @@ public class ConfigFieldParserIssue1057Test {
|
|||
@Test
|
||||
public void testBitsPadding() throws IOException {
|
||||
ReaderState state = new ReaderState();
|
||||
JavaFieldsConsumer javaFieldsConsumer = new JavaFieldsConsumer(state) {
|
||||
@Override
|
||||
public void startFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endFile() {
|
||||
}
|
||||
};
|
||||
JavaFieldsConsumer javaFieldsConsumer = new TestJavaFieldsConsumer(state);
|
||||
|
||||
String inputString = "struct pid_s\nbit activateAuxPid1;\n" +
|
||||
"int fieldName;\n" +
|
||||
|
|
|
@ -45,7 +45,7 @@ public class ConfigFieldParserTest {
|
|||
ReaderState state = new ReaderState();
|
||||
BufferedReader reader = new BufferedReader(new StringReader(test));
|
||||
|
||||
JavaFieldsConsumer javaFieldsConsumer = createTestJavaConsumer(state);
|
||||
JavaFieldsConsumer javaFieldsConsumer = new TestJavaFieldsConsumer(state);
|
||||
state.readBufferedReader(reader, Arrays.asList(javaFieldsConsumer));
|
||||
|
||||
assertEquals(16, TypesHelper.getElementSize(state, "pid_s"));
|
||||
|
@ -77,7 +77,7 @@ public class ConfigFieldParserTest {
|
|||
"";
|
||||
BufferedReader reader = new BufferedReader(new StringReader(test));
|
||||
|
||||
JavaFieldsConsumer javaFieldsConsumer = createTestJavaConsumer(state);
|
||||
JavaFieldsConsumer javaFieldsConsumer = new TestJavaFieldsConsumer(state);
|
||||
|
||||
FsioSettingsConsumer fsioSettingsConsumer = new FsioSettingsConsumer(state) {
|
||||
@Override
|
||||
|
@ -162,18 +162,6 @@ public class ConfigFieldParserTest {
|
|||
}
|
||||
}
|
||||
|
||||
private JavaFieldsConsumer createTestJavaConsumer(ReaderState state) {
|
||||
return new JavaFieldsConsumer(state) {
|
||||
@Override
|
||||
public void startFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endFile() {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseLine() {
|
||||
ReaderState state = new ReaderState();
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.rusefi.test;
|
||||
|
||||
import com.rusefi.ReaderState;
|
||||
import com.rusefi.output.JavaFieldsConsumer;
|
||||
|
||||
public class TestJavaFieldsConsumer extends JavaFieldsConsumer {
|
||||
public TestJavaFieldsConsumer(ReaderState state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startFile() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endFile() {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue