Skip to content
Snippets Groups Projects
Commit d37e1825 authored by René Schöne's avatar René Schöne
Browse files

Finalize tests for initial JavaHandler

- try to find cause for failing RelationTest
parent bd417431
No related branches found
No related tags found
1 merge request!30Feature: JavaHandler
Pipeline #13728 passed
Showing
with 39 additions and 15 deletions
...@@ -42,6 +42,8 @@ test: ...@@ -42,6 +42,8 @@ test:
- ./gradlew --console=plain --no-daemon allTests - ./gradlew --console=plain --no-daemon allTests
artifacts: artifacts:
when: always when: always
paths:
- "ragconnect.tests/test.log"
reports: reports:
junit: "ragconnect.tests/build/test-results/**/TEST-*.xml" junit: "ragconnect.tests/build/test-results/**/TEST-*.xml"
expire_in: 1 week expire_in: 1 week
......
...@@ -3,3 +3,4 @@ src/gen-res/ ...@@ -3,3 +3,4 @@ src/gen-res/
src/gen/ src/gen/
out/ out/
*.class *.class
test.log
...@@ -14,14 +14,12 @@ import java.util.concurrent.TimeUnit; ...@@ -14,14 +14,12 @@ import java.util.concurrent.TimeUnit;
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("mqtt") @Tag("mqtt")
public abstract class AbstractMqttTest { public abstract class AbstractMqttTest extends RagConnectTest {
private static boolean checkDone = false; private static boolean checkDone = false;
protected static MqttHandler publisher; protected static MqttHandler publisher;
protected Logger logger = LoggerFactory.getLogger(getClass());
/** /**
* if the initial/current value shall be sent upon connecting * if the initial/current value shall be sent upon connecting
*/ */
...@@ -61,7 +59,6 @@ public abstract class AbstractMqttTest { ...@@ -61,7 +59,6 @@ public abstract class AbstractMqttTest {
public final void testCommunicateSendInitialValue() throws IOException, InterruptedException { public final void testCommunicateSendInitialValue() throws IOException, InterruptedException {
this.writeCurrentValue = true; this.writeCurrentValue = true;
logger.debug("Start testCommunicateSendInitialValue");
createModel(); createModel();
setupReceiverAndConnect(); setupReceiverAndConnect();
...@@ -80,7 +77,6 @@ public abstract class AbstractMqttTest { ...@@ -80,7 +77,6 @@ public abstract class AbstractMqttTest {
public final void testCommunicateOnlyUpdatedValue() throws IOException, InterruptedException { public final void testCommunicateOnlyUpdatedValue() throws IOException, InterruptedException {
this.writeCurrentValue = false; this.writeCurrentValue = false;
logger.debug("Start testCommunicateOnlyUpdatedValue");
createModel(); createModel();
setupReceiverAndConnect(); setupReceiverAndConnect();
......
...@@ -22,9 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; ...@@ -22,9 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* *
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
public class Errors { public class Errors extends RagConnectTest {
private static final Logger logger = LoggerFactory.getLogger(Errors.class);
private static final String ERROR_DIRECTORY = "errors/"; private static final String ERROR_DIRECTORY = "errors/";
private static final String OUTPUT_DIRECTORY = TestUtils.OUTPUT_DIRECTORY_PREFIX + ERROR_DIRECTORY; private static final String OUTPUT_DIRECTORY = TestUtils.OUTPUT_DIRECTORY_PREFIX + ERROR_DIRECTORY;
......
...@@ -21,8 +21,7 @@ import static org.junit.jupiter.api.Assertions.*; ...@@ -21,8 +21,7 @@ import static org.junit.jupiter.api.Assertions.*;
* *
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("New") public class JavaTest extends RagConnectTest {
public class JavaTest {
private static final String TOPIC_RECEIVE_TOKEN = "receiveToken"; private static final String TOPIC_RECEIVE_TOKEN = "receiveToken";
private static final String TOPIC_RECEIVE_NODE_PLAIN = "receiveNode/plain"; private static final String TOPIC_RECEIVE_NODE_PLAIN = "receiveNode/plain";
...@@ -35,7 +34,6 @@ public class JavaTest { ...@@ -35,7 +34,6 @@ public class JavaTest {
private static final String TOPIC_SEND_MANY = "sendMany"; private static final String TOPIC_SEND_MANY = "sendMany";
private static final String TOPIC_SEND_NTA = "sendNTA"; private static final String TOPIC_SEND_NTA = "sendNTA";
protected Logger logger = LoggerFactory.getLogger(getClass());
private Root model; private Root model;
private SenderRoot senderRoot; private SenderRoot senderRoot;
private ReceiverRoot receiverRoot; private ReceiverRoot receiverRoot;
......
...@@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; ...@@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("mqtt") @Tag("mqtt")
public class MqttHandlerTest { public class MqttHandlerTest extends RagConnectTest {
@Test @Test
public void defaultBehaviour() { public void defaultBehaviour() {
......
package org.jastadd.ragconnect.tests;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Base for all RagConnect tests.
*
* @author rschoene - Initial contribution
*/
public class RagConnectTest {
protected Logger logger = LoggerFactory.getLogger(getClass());
@BeforeEach
public void logStart(TestInfo testInfo) {
logger.info("Starting {}.{}", getClass().getSimpleName(), testInfo.getDisplayName());
}
@AfterEach
public void logEnd(TestInfo testInfo) {
logger.info("Finished {}.{}", getClass().getSimpleName(), testInfo.getDisplayName());
}
}
...@@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.*; ...@@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.*;
* *
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
public class RegressionTests { public class RegressionTests extends RagConnectTest {
private static final String REGRESSION_TEST_OUTPUT_DIRECTORY = "regression-test/"; private static final String REGRESSION_TEST_OUTPUT_DIRECTORY = "regression-test/";
......
...@@ -21,9 +21,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; ...@@ -21,9 +21,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* *
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
public class Warnings { public class Warnings extends RagConnectTest {
private static final Logger logger = LoggerFactory.getLogger(Warnings.class);
private static final String WARNING_DIRECTORY = "warnings/"; private static final String WARNING_DIRECTORY = "warnings/";
private static final String OUTPUT_DIRECTORY = TestUtils.OUTPUT_DIRECTORY_PREFIX + WARNING_DIRECTORY; private static final String OUTPUT_DIRECTORY = TestUtils.OUTPUT_DIRECTORY_PREFIX + WARNING_DIRECTORY;
......
...@@ -616,7 +616,7 @@ public class RelationTest extends AbstractMqttTest { ...@@ -616,7 +616,7 @@ public class RelationTest extends AbstractMqttTest {
biB(3).getInner().setInnerValue("inner-bi-b3"); biB(3).getInner().setInnerValue("inner-bi-b3");
checker.check(); checker.check();
System.out.println(model.ragconnectEvaluationCounterSummary()); logger.debug(model.ragconnectEvaluationCounterSummary());
} }
private void assertNullOrA(String expectedValue, A actual, String alias) { private void assertNullOrA(String expectedValue, A actual, String alias) {
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<Console name="Console" target="SYSTEM_OUT"> <Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level [%t] %logger{20} - %msg%n}" disableAnsi="false"/> <PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level [%t] %logger{20} - %msg%n}" disableAnsi="false"/>
</Console> </Console>
<File name="TestLogs" fileName="test.log" append="false">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level [%t] %logger{20} - %msg%n"/>
</File>
</Appenders> </Appenders>
<Loggers> <Loggers>
<Root level="debug"> <Root level="debug">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment