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
This commit is part of merge request !30. Comments created here will be created in the context of that merge request.
Showing
with 39 additions and 15 deletions
......@@ -42,6 +42,8 @@ test:
- ./gradlew --console=plain --no-daemon allTests
artifacts:
when: always
paths:
- "ragconnect.tests/test.log"
reports:
junit: "ragconnect.tests/build/test-results/**/TEST-*.xml"
expire_in: 1 week
......
......@@ -3,3 +3,4 @@ src/gen-res/
src/gen/
out/
*.class
test.log
......@@ -14,14 +14,12 @@ import java.util.concurrent.TimeUnit;
* @author rschoene - Initial contribution
*/
@Tag("mqtt")
public abstract class AbstractMqttTest {
public abstract class AbstractMqttTest extends RagConnectTest {
private static boolean checkDone = false;
protected static MqttHandler publisher;
protected Logger logger = LoggerFactory.getLogger(getClass());
/**
* if the initial/current value shall be sent upon connecting
*/
......@@ -61,7 +59,6 @@ public abstract class AbstractMqttTest {
public final void testCommunicateSendInitialValue() throws IOException, InterruptedException {
this.writeCurrentValue = true;
logger.debug("Start testCommunicateSendInitialValue");
createModel();
setupReceiverAndConnect();
......@@ -80,7 +77,6 @@ public abstract class AbstractMqttTest {
public final void testCommunicateOnlyUpdatedValue() throws IOException, InterruptedException {
this.writeCurrentValue = false;
logger.debug("Start testCommunicateOnlyUpdatedValue");
createModel();
setupReceiverAndConnect();
......
......@@ -22,9 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @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 OUTPUT_DIRECTORY = TestUtils.OUTPUT_DIRECTORY_PREFIX + ERROR_DIRECTORY;
......
......@@ -21,8 +21,7 @@ import static org.junit.jupiter.api.Assertions.*;
*
* @author rschoene - Initial contribution
*/
@Tag("New")
public class JavaTest {
public class JavaTest extends RagConnectTest {
private static final String TOPIC_RECEIVE_TOKEN = "receiveToken";
private static final String TOPIC_RECEIVE_NODE_PLAIN = "receiveNode/plain";
......@@ -35,7 +34,6 @@ public class JavaTest {
private static final String TOPIC_SEND_MANY = "sendMany";
private static final String TOPIC_SEND_NTA = "sendNTA";
protected Logger logger = LoggerFactory.getLogger(getClass());
private Root model;
private SenderRoot senderRoot;
private ReceiverRoot receiverRoot;
......
......@@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* @author rschoene - Initial contribution
*/
@Tag("mqtt")
public class MqttHandlerTest {
public class MqttHandlerTest extends RagConnectTest {
@Test
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.*;
*
* @author rschoene - Initial contribution
*/
public class RegressionTests {
public class RegressionTests extends RagConnectTest {
private static final String REGRESSION_TEST_OUTPUT_DIRECTORY = "regression-test/";
......
......@@ -21,9 +21,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @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 OUTPUT_DIRECTORY = TestUtils.OUTPUT_DIRECTORY_PREFIX + WARNING_DIRECTORY;
......
......@@ -616,7 +616,7 @@ public class RelationTest extends AbstractMqttTest {
biB(3).getInner().setInnerValue("inner-bi-b3");
checker.check();
System.out.println(model.ragconnectEvaluationCounterSummary());
logger.debug(model.ragconnectEvaluationCounterSummary());
}
private void assertNullOrA(String expectedValue, A actual, String alias) {
......
......@@ -4,6 +4,9 @@
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%highlight{%d{HH:mm:ss.SSS} %-5level [%t] %logger{20} - %msg%n}" disableAnsi="false"/>
</Console>
<File name="TestLogs" fileName="test.log" append="false">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level [%t] %logger{20} - %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="debug">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment