Fix hanging timeout on Executor test 03/105003/1
authorliamfallon <liam.fallon@est.tech>
Wed, 1 Apr 2020 08:38:33 +0000 (09:38 +0100)
committerliamfallon <liam.fallon@est.tech>
Thu, 2 Apr 2020 15:33:47 +0000 (16:33 +0100)
Issue-ID: POLICY-2106
Change-Id: I7bd44f8dfe349d73a4c8c4f978a30b455c45b2c7
Signed-off-by: liamfallon <liam.fallon@est.tech>
24 files changed:
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FileDelete.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FileGet.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FileGetConsumerAlone.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FileGetEmpty.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FileGetMulti.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FileGetProducerAlone.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FilePost.json
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/prodcons/File2RESTRequest2FilePut.json
plugins/plugins-executor/plugins-executor-javascript/pom.xml
plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptExecutor.java
plugins/plugins-executor/plugins-executor-javascript/src/test/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptExecutorTest.java
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexEventUnmarshaller.java
testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJRuby.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/file/TestFile2FileIgnore.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restclient/TestRest2File.java
testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/adapt/restserver/TestRestServer.java
testsuites/integration/integration-uservice-test/src/test/resources/logback-test.xml [new file with mode: 0644]
testsuites/integration/integration-uservice-test/src/test/resources/prodcons/REST2FileJsonEmptyEvents.json
testsuites/integration/integration-uservice-test/src/test/resources/prodcons/REST2FileJsonEventBadHTTPMethod.json
testsuites/integration/integration-uservice-test/src/test/resources/prodcons/REST2FileJsonEventBadResponse.json
testsuites/integration/integration-uservice-test/src/test/resources/prodcons/REST2FileJsonEventBadURL.json
testsuites/integration/integration-uservice-test/src/test/resources/prodcons/REST2FileJsonEventNoURL.json
testsuites/integration/integration-uservice-test/src/test/resources/testdata/executionproperties/RESTEventBadHttpCodeFilter.json

index 55baf3c..326be51 100644 (file)
@@ -25,14 +25,16 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import com.google.gson.Gson;
+
 import java.io.ByteArrayOutputStream;
-import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Map;
+
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.core.Response;
+
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -66,8 +68,8 @@ public class RestRequestorTest {
      */
     @BeforeClass
     public static void setUp() throws Exception {
-        server = HttpServletServerFactoryInstance.getServerFactory().build(
-            null, false, null, PORT, "/TestRESTRequestor", false, false);
+        server = HttpServletServerFactoryInstance.getServerFactory().build(null, false, null, PORT,
+            "/TestRESTRequestor", false, false);
 
         server.addServletClass(null, SupportRestRequestorEndpoint.class.getName());
         server.setSerializationProvider(GsonMessageBodyHandler.class.getName());
@@ -89,10 +91,6 @@ public class RestRequestorTest {
         if (server != null) {
             server.stop();
         }
-
-        new File("src/test/resources/events/EventsOut.json").delete();
-        new File("src/test/resources/events/EventsOutMulti0.json").delete();
-        new File("src/test/resources/events/EventsOutMulti1.json").delete();
     }
 
     /**
@@ -114,8 +112,7 @@ public class RestRequestorTest {
     public void testRestRequestorGet() throws MessagingException, ApexException, IOException {
         final Client client = ClientBuilder.newClient();
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FileGet.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileGet.json"};
         final ApexMain apexMain = new ApexMain(args);
 
         Response response = null;
@@ -126,7 +123,7 @@ public class RestRequestorTest {
             ThreadUtilities.sleep(100);
 
             response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
-                            .request("application/json").get();
+                .request("application/json").get();
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -162,8 +159,7 @@ public class RestRequestorTest {
     public void testRestRequestorGetEmpty() throws MessagingException, ApexException, IOException {
         final Client client = ClientBuilder.newClient();
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FileGetEmpty.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileGetEmpty.json"};
         final ApexMain apexMain = new ApexMain(args);
 
         Response response = null;
@@ -174,7 +170,7 @@ public class RestRequestorTest {
             ThreadUtilities.sleep(100);
 
             response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
-                            .request("application/json").get();
+                .request("application/json").get();
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -208,8 +204,7 @@ public class RestRequestorTest {
     public void testRestRequestorPut() throws MessagingException, ApexException, IOException {
         final Client client = ClientBuilder.newClient();
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FilePut.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FilePut.json"};
         final ApexMain apexMain = new ApexMain(args);
 
         // Wait for the required amount of events to be received or for 10 seconds
@@ -220,7 +215,7 @@ public class RestRequestorTest {
             ThreadUtilities.sleep(100);
 
             response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
-                            .request("application/json").get();
+                .request("application/json").get();
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -255,8 +250,7 @@ public class RestRequestorTest {
     public void testRestRequestorPost() throws MessagingException, ApexException, IOException {
         final Client client = ClientBuilder.newClient();
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FilePost.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FilePost.json"};
         final ApexMain apexMain = new ApexMain(args);
 
         // Wait for the required amount of events to be received or for 10 seconds
@@ -265,7 +259,7 @@ public class RestRequestorTest {
             ThreadUtilities.sleep(100);
 
             final Response response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
-                            .request("application/json").get();
+                .request("application/json").get();
 
             assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
             final String responseString = response.readEntity(String.class);
@@ -296,8 +290,7 @@ public class RestRequestorTest {
     public void testRestRequestorDelete() throws MessagingException, ApexException, IOException {
         final Client client = ClientBuilder.newClient();
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FileDelete.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileDelete.json"};
         final ApexMain apexMain = new ApexMain(args);
 
         // Wait for the required amount of events to be received or for 10 seconds
@@ -306,7 +299,7 @@ public class RestRequestorTest {
             ThreadUtilities.sleep(100);
 
             final Response response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
-                            .request("application/json").get();
+                .request("application/json").get();
 
             assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
             final String responseString = response.readEntity(String.class);
@@ -337,8 +330,7 @@ public class RestRequestorTest {
     public void testRestRequestorMultiInputs() throws MessagingException, ApexException, IOException {
         final Client client = ClientBuilder.newClient();
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FileGetMulti.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileGetMulti.json"};
         final ApexMain apexMain = new ApexMain(args);
 
         // Wait for the required amount of events to be received or for 10 seconds
@@ -347,7 +339,7 @@ public class RestRequestorTest {
             ThreadUtilities.sleep(100);
 
             final Response response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
-                            .request("application/json").get();
+                .request("application/json").get();
 
             assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
             final String responseString = response.readEntity(String.class);
@@ -379,8 +371,7 @@ public class RestRequestorTest {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FileGetProducerAlone.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileGetProducerAlone.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
@@ -392,7 +383,7 @@ public class RestRequestorTest {
         System.setErr(stderr);
 
         assertTrue(outString.contains("REST Requestor producer (RestRequestorProducer) "
-                        + "must run in peered requestor mode with a REST Requestor consumer"));
+            + "must run in peered requestor mode with a REST Requestor consumer"));
     }
 
     /**
@@ -407,8 +398,7 @@ public class RestRequestorTest {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/File2RESTRequest2FileGetConsumerAlone.json" };
+        final String[] args = {"src/test/resources/prodcons/File2RESTRequest2FileGetConsumerAlone.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
@@ -420,6 +410,6 @@ public class RestRequestorTest {
         System.setErr(stderr);
 
         assertTrue(outString.contains("peer \"RestRequestorProducer for peered mode REQUESTOR "
-                        + "does not exist or is not defined with the same peered mode"));
+            + "does not exist or is not defined with the same peered mode"));
     }
 }
index 3a27a48..d6234ca 100644 (file)
@@ -62,7 +62,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index aaf14e5..4b36b50 100644 (file)
@@ -62,7 +62,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 145d383..9374d9b 100644 (file)
@@ -58,7 +58,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index ebf9d05..21e25f0 100644 (file)
@@ -62,7 +62,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 5b4344b..d476a22 100644 (file)
@@ -90,7 +90,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOutMulti0.json"
+                    "fileName": "target/EventsOutMulti0.json"
                 }
             },
             "eventProtocolParameters": {
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOutMulti1.json"
+                    "fileName": "target/EventsOutMulti1.json"
                 }
             },
             "eventProtocolParameters": {
index b50b8bd..f4614d5 100644 (file)
@@ -42,7 +42,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index abe50d7..2edc2c6 100644 (file)
@@ -62,7 +62,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index fa4e4e3..0b53dc6 100644 (file)
@@ -66,7 +66,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 007a03a..80fe06c 100644 (file)
@@ -59,7 +59,6 @@
             <artifactId>awaitility</artifactId>
             <scope>test</scope>
         </dependency>
-
     </dependencies>
 
     <profiles>
index a33a129..489489f 100644 (file)
@@ -50,8 +50,12 @@ public class JavascriptExecutor implements Runnable {
 
     public static final int DEFAULT_OPTIMIZATION_LEVEL = 9;
 
+    // Token passed to executor thread to stop execution
+    private static final Object STOP_EXECUTION_TOKEN = "*** STOP EXECUTION ***";
+
     // Recurring string constants
     private static final String WITH_MESSAGE = " with message: ";
+    private static final String JAVASCRIPT_EXECUTOR = "JavascriptExecutor ";
 
     @Setter(AccessLevel.PROTECTED)
     private static TimeUnit timeunit4Latches = TimeUnit.SECONDS;
@@ -120,7 +124,7 @@ public class JavascriptExecutor implements Runnable {
         try {
             if (!intializationLatch.await(intializationLatchTimeout, timeunit4Latches)) {
                 executorThread.interrupt();
-                throw new StateMachineException("JavascriptExecutor " + subjectKey.getId()
+                throw new StateMachineException(JAVASCRIPT_EXECUTOR + subjectKey.getId()
                     + " initiation timed out after " + intializationLatchTimeout + " " + timeunit4Latches);
             }
         } catch (InterruptedException e) {
@@ -160,7 +164,7 @@ public class JavascriptExecutor implements Runnable {
             executorThread.interrupt();
             Thread.currentThread().interrupt();
             throw new StateMachineException(
-                "JavascriptExecutor " + subjectKey.getId() + "interrupted on execution result wait", e);
+                JAVASCRIPT_EXECUTOR + subjectKey.getId() + "interrupted on execution result wait", e);
         }
 
         checkAndThrowExecutorException();
@@ -179,11 +183,11 @@ public class JavascriptExecutor implements Runnable {
         }
 
         if (executorThread.isAlive()) {
-            executorThread.interrupt();
+            executionQueue.add(STOP_EXECUTION_TOKEN);
 
             try {
                 if (!cleanupLatch.await(cleanupLatchTimeout, timeunit4Latches)) {
-                    executorException.set(new StateMachineException("JavascriptExecutor " + subjectKey.getId()
+                    executorException.set(new StateMachineException(JAVASCRIPT_EXECUTOR + subjectKey.getId()
                         + " cleanup timed out after " + cleanupLatchTimeout + " " + timeunit4Latches));
                 }
             } catch (InterruptedException e) {
@@ -221,12 +225,14 @@ public class JavascriptExecutor implements Runnable {
         while (!Thread.currentThread().isInterrupted()) {
             try {
                 Object contextObject = executionQueue.take();
-
-                boolean result = executeScript(contextObject);
-                resultQueue.add(result);
+                if (STOP_EXECUTION_TOKEN.equals(contextObject)) {
+                    LOGGER.debug("execution close was ordered for  " + subjectKey.getId());
+                    break;
+                }
+                resultQueue.add(executeScript(contextObject));
             } catch (final InterruptedException e) {
                 LOGGER.debug("execution was interruped for " + subjectKey.getId() + WITH_MESSAGE + e.getMessage(), e);
-                resultQueue.add(false);
+                executionQueue.add(STOP_EXECUTION_TOKEN);
                 Thread.currentThread().interrupt();
             } catch (StateMachineException sme) {
                 executorException.set(sme);
@@ -234,6 +240,8 @@ public class JavascriptExecutor implements Runnable {
             }
         }
 
+        resultQueue.add(false);
+
         try {
             Context.exit();
         } catch (final Exception e) {
index 53781e8..6ea15fc 100644 (file)
@@ -267,7 +267,7 @@ public class JavascriptExecutorTest {
         }).doesNotThrowAnyException();
 
         assertThatCode(() -> {
-            executor.init("while (true) { x = 1; }; true;");
+            executor.init("var x = 0; while (x < 100) { x++; }; true;");
         }).doesNotThrowAnyException();
 
         concurrentResult.set(true);
@@ -276,13 +276,18 @@ public class JavascriptExecutorTest {
         (new Thread() {
             public void run() {
                 try {
-                    concurrentResult.set(executor.execute("hello"));
+                    while (executor.execute("hello")) {
+                        // Loop until interrupted
+                    }
+                    concurrentResult.set(false);
                 } catch (StateMachineException e) {
-                    e.printStackTrace();
+                    // Do nothing
                 }
             }
         }).start();
 
+        await().atMost(1000, TimeUnit.MILLISECONDS).until(() -> executor.getExecutorThread().isAlive());
+
         executor.getExecutorThread().interrupt();
 
         await().atMost(1000, TimeUnit.MILLISECONDS).until(() -> !concurrentResult.get());
index 8708e97..2c1c900 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
      * @param consumerParameters the consumer parameters for this specific unmarshaler
      */
     public ApexEventUnmarshaller(final String name, final EngineServiceParameters engineServiceParameters,
-            final EventHandlerParameters consumerParameters) {
+        final EventHandlerParameters consumerParameters) {
         this.name = name;
         this.engineServiceParameters = engineServiceParameters;
         this.consumerParameters = consumerParameters;
@@ -123,7 +123,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
 
         // Configure and start the event reception thread
         final String threadName =
-                engineServiceParameters.getEngineKey().getName() + ":" + this.getClass().getName() + ":" + name;
+            engineServiceParameters.getEngineKey().getName() + ":" + this.getClass().getName() + ":" + name;
         unmarshallerThread = new ApplicationThreadFactory(threadName).newThread(this);
         unmarshallerThread.setDaemon(true);
         unmarshallerThread.start();
@@ -168,7 +168,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
                 // To connect a synchronous unmarshaler and marshaler, we create a synchronous event
                 // cache on the consumer/producer pair
                 new SynchronousEventCache(peeredMode, consumer, peeredMarshaller.getProducer(),
-                        consumerParameters.getPeerTimeout(EventHandlerPeeredMode.SYNCHRONOUS));
+                    consumerParameters.getPeerTimeout(EventHandlerPeeredMode.SYNCHRONOUS));
                 return;
 
             case REQUESTOR:
@@ -185,7 +185,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
      */
     @Override
     public void receiveEvent(@NonNull final Properties executionProperties, final Object event)
-            throws ApexEventException {
+        throws ApexEventException {
         receiveEvent(0, executionProperties, event, true);
     }
 
@@ -194,7 +194,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
      */
     @Override
     public void receiveEvent(final long executionId, @NonNull final Properties executionProperties, final Object event)
-            throws ApexEventException {
+        throws ApexEventException {
         receiveEvent(executionId, executionProperties, event, false);
     }
 
@@ -208,7 +208,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
      * @throws ApexEventException on unmarshaling errors on events
      */
     private void receiveEvent(final long executionId, final Properties executionProperties, final Object event,
-            final boolean generateExecutionId) throws ApexEventException {
+        final boolean generateExecutionId) throws ApexEventException {
         // Push the event onto the queue
         if (LOGGER.isTraceEnabled()) {
             String eventString = "onMessage(): event received: " + event.toString();
@@ -234,19 +234,19 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
 
                 apexEvent.setExecutionProperties(executionProperties);
 
-                // Enqueue the event
-                queue.add(apexEvent);
-
                 // Cache synchronized events that are sent
                 if (consumerParameters.isPeeredMode(EventHandlerPeeredMode.SYNCHRONOUS)) {
                     final SynchronousEventCache synchronousEventCache =
-                            (SynchronousEventCache) consumer.getPeeredReference(EventHandlerPeeredMode.SYNCHRONOUS);
+                        (SynchronousEventCache) consumer.getPeeredReference(EventHandlerPeeredMode.SYNCHRONOUS);
                     synchronousEventCache.cacheSynchronizedEventToApex(apexEvent.getExecutionId(), apexEvent);
                 }
+
+                // Enqueue the event
+                queue.add(apexEvent);
             }
         } catch (final ApexException e) {
             final String errorMessage = "Error while converting event into an ApexEvent for " + name + ": "
-                    + e.getMessage() + ", Event=" + event;
+                + e.getMessage() + ", Event=" + event;
             LOGGER.warn(errorMessage, e);
             throw new ApexEventException(errorMessage, e);
         }
@@ -261,11 +261,11 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
         // Check if we are filtering events on this unmarshaler, if so check the event name
         // against the filter
         if (consumerParameters.isSetEventNameFilter()
-                && !apexEvent.getName().matches(consumerParameters.getEventNameFilter())) {
+            && !apexEvent.getName().matches(consumerParameters.getEventNameFilter())) {
 
             if (LOGGER.isTraceEnabled()) {
                 LOGGER.trace("onMessage(): event {} not processed, filtered  out by filter", apexEvent,
-                        consumerParameters.getEventNameFilter());
+                    consumerParameters.getEventNameFilter());
             }
 
             return true;
@@ -330,7 +330,7 @@ public class ApexEventUnmarshaller implements ApexEventReceiver, Runnable {
 
         // Order a stop on the synchronous cache if one exists
         if (consumerParameters != null && consumerParameters.isPeeredMode(EventHandlerPeeredMode.SYNCHRONOUS)
-                && consumer.getPeeredReference(EventHandlerPeeredMode.SYNCHRONOUS) != null) {
+            && consumer.getPeeredReference(EventHandlerPeeredMode.SYNCHRONOUS) != null) {
             ((SynchronousEventCache) consumer.getPeeredReference(EventHandlerPeeredMode.SYNCHRONOUS)).stop();
         }
 
index f344add..8544e35 100644 (file)
@@ -21,6 +21,8 @@
 
 package org.onap.policy.apex.testsuites.integration.executor.engine;
 
+import static org.assertj.core.api.Assertions.assertThatCode;
+
 import java.io.IOException;
 
 import org.junit.After;
@@ -96,7 +98,8 @@ public class TestApexEngineJRuby {
      */
     @Test
     public void testApexEngineJRuby() throws ApexException, InterruptedException, IOException {
-        new TestApexEngine("JRUBY", engineParameters);
-        new TestApexEngine("JRUBY", engineParameters);
+        assertThatCode(() -> {
+            new TestApexEngine("JRUBY", engineParameters);
+        }).doesNotThrowAnyException();
     }
 }
index b9d3bb3..1bbbbb7 100644 (file)
@@ -51,9 +51,7 @@ public class TestFile2FileIgnore {
     public static void main(final String[] args) throws MessagingException, ApexException, IOException {
         final String[] apexArgs = {"-rfr", "target", "-c", "examples/config/SampleDomain/File2FileJsonEvent.json"};
 
-        new File("src/test/resources/events/EventsOut.json").delete();
-
-        testFileEvents(apexArgs, "src/test/resources/events/EventsOut.json", 48656);
+        testFileEvents(apexArgs, "target/EventsOut.json", 48656);
     }
 
     /**
@@ -67,7 +65,7 @@ public class TestFile2FileIgnore {
      * @throws IOException Signals that an I/O exception has occurred.
      */
     private static void testFileEvents(final String[] args, final String outFilePath, final long expectedFileSize)
-            throws MessagingException, ApexException, IOException {
+        throws MessagingException, ApexException, IOException {
         final ApexMain apexMain = new ApexMain(args);
 
         final File outFile = new File(outFilePath);
@@ -104,6 +102,6 @@ public class TestFile2FileIgnore {
      */
     private static String stripVariableLengthText(final String outFile) throws IOException {
         return TextFileUtils.getTextFileAsString(outFile).replaceAll("\\s+", "").replaceAll(":\\d*\\.?\\d*,", ":0,")
-                .replaceAll(":\\d*}", ":0}").replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
+            .replaceAll(":\\d*}", ":0}").replaceAll("<value>\\d*\\.?\\d*</value>", "<value>0</value>");
     }
 }
index 3243cd7..39a5244 100644 (file)
@@ -24,12 +24,10 @@ package org.onap.policy.apex.testsuites.integration.uservice.adapt.restclient;
 import static org.junit.Assert.fail;
 
 import java.io.ByteArrayOutputStream;
-import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
 
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
@@ -75,7 +73,7 @@ public class TestRest2File {
     @Before
     public void setUp() throws Exception {
         server = HttpServletServerFactoryInstance.getServerFactory().build("TestRest2File", false, null, PORT,
-                "/TestRest2File", false, false);
+            "/TestRest2File", false, false);
 
         server.addServletClass(null, TestRestClientEndpoint.class.getName());
         server.setSerializationProvider(GsonMessageBodyHandler.class.getName());
@@ -99,14 +97,6 @@ public class TestRest2File {
         }
     }
 
-    /**
-     * Delete temp files.
-     */
-    @AfterClass
-    public static void deleteTempFiles() {
-        new File("src/test/resources/events/EventsOut.json").delete();
-    }
-
     /**
      * Test rest events in.
      *
@@ -124,10 +114,10 @@ public class TestRest2File {
         apexMain.shutdown();
 
         final String outputEventText =
-                TextFileUtils.getTextFileAsString("target/examples/events/SampleDomain/EventsOut.json");
+            TextFileUtils.getTextFileAsString("target/examples/events/SampleDomain/EventsOut.json");
 
         checkRequiredString(outputEventText,
-                "04\",\n" + "  \"version\": \"0.0.1\",\n" + "  \"nameSpace\": \"org.onap.policy.apex.sample.events\"");
+            "04\",\n" + "  \"version\": \"0.0.1\",\n" + "  \"nameSpace\": \"org.onap.policy.apex.sample.events\"");
     }
 
     /**
@@ -153,8 +143,8 @@ public class TestRest2File {
         System.setOut(stdout);
         System.setErr(stderr);
 
-        checkRequiredString(outString, "received an empty event from URL "
-                + "\"http://localhost:32801/TestRest2File/apex/event/GetEmptyEvent\"");
+        checkRequiredString(outString,
+            "received an empty event from URL " + "\"http://localhost:32801/TestRest2File/apex/event/GetEmptyEvent\"");
     }
 
     /**
@@ -207,7 +197,7 @@ public class TestRest2File {
         System.setErr(stderr);
 
         checkRequiredString(outString, "reception of event from URL "
-                + "\"http://localhost:32801/TestRest2File/apex/event/Bad\" failed with status code 404");
+            + "\"http://localhost:32801/TestRest2File/apex/event/Bad\" failed with status code 404");
     }
 
     /**
@@ -234,7 +224,7 @@ public class TestRest2File {
         System.setErr(stderr);
 
         checkRequiredString(outString, "specified HTTP method of \"POST\" is invalid, "
-                + "only HTTP method \"GET\" is supported for event reception on REST client consumer");
+            + "only HTTP method \"GET\" is supported for event reception on REST client consumer");
     }
 
     /**
@@ -261,9 +251,8 @@ public class TestRest2File {
         System.setErr(stderr);
 
         checkRequiredString(outString,
-                "reception of event from URL "
-                        + "\"http://localhost:32801/TestRest2File/apex/event/GetEventBadResponse\" "
-                        + "failed with status code 400 and message \"");
+            "reception of event from URL " + "\"http://localhost:32801/TestRest2File/apex/event/GetEventBadResponse\" "
+                + "failed with status code 400 and message \"");
     }
 
     /**
index 98eebf5..4f6ef29 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.apex.testsuites.integration.uservice.adapt.restserver;
 
+import static org.awaitility.Awaitility.await;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import com.google.gson.Gson;
+
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Map;
 import java.util.Random;
+import java.util.concurrent.TimeUnit;
+
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.client.Entity;
 import javax.ws.rs.core.Response;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
@@ -79,8 +84,7 @@ public class TestRestServer {
     public void testRestServerPut() throws MessagingException, ApexException, IOException, InterruptedException {
         LOGGER.debug("testRestServerPut start");
 
-        final String[] args =
-            { "-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEvent.json" };
+        final String[] args = {"-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEvent.json"};
         final ApexMain apexMain = new ApexMain(args);
         if (!NetworkUtil.isTcpPortOpen("localhost", 23324, 60, 500L)) {
             throw new IllegalStateException("cannot connect to Apex Rest Server");
@@ -92,7 +96,7 @@ public class TestRestServer {
 
         for (int i = 0; i < 20; i++) {
             response = client.target("http://localhost:23324/apex/FirstConsumer/EventIn").request("application/json")
-                            .put(Entity.json(getEvent()));
+                .put(Entity.json(getEvent()));
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -105,6 +109,8 @@ public class TestRestServer {
 
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
         assertEquals("org.onap.policy.apex.sample.events", jsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", jsonMap.get("TestSlogan"));
@@ -123,8 +129,7 @@ public class TestRestServer {
     @Test
     public void testRestServerPost() throws MessagingException, ApexException, IOException, InterruptedException {
         LOGGER.debug("testRestServerPost start");
-        final String[] args =
-            { "-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEvent.json" };
+        final String[] args = {"-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEvent.json"};
         final ApexMain apexMain = new ApexMain(args);
         if (!NetworkUtil.isTcpPortOpen("localhost", 23324, 60, 500L)) {
             throw new IllegalStateException("cannot connect to Apex Rest Server");
@@ -136,7 +141,7 @@ public class TestRestServer {
 
         for (int i = 0; i < 20; i++) {
             response = client.target("http://localhost:23324/apex/FirstConsumer/EventIn").request("application/json")
-                            .post(Entity.json(getEvent()));
+                .post(Entity.json(getEvent()));
 
             if (Response.Status.OK.getStatusCode() != response.getStatus()) {
                 break;
@@ -149,6 +154,8 @@ public class TestRestServer {
 
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
         assertEquals("org.onap.policy.apex.sample.events", jsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", jsonMap.get("TestSlogan"));
@@ -166,8 +173,7 @@ public class TestRestServer {
     @Test
     public void testRestServerGetStatus() throws MessagingException, ApexException, IOException, InterruptedException {
         LOGGER.debug("testRestServerGetStatus start");
-        final String[] args =
-            { "-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEvent.json" };
+        final String[] args = {"-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEvent.json"};
         final ApexMain apexMain = new ApexMain(args);
         if (!NetworkUtil.isTcpPortOpen("localhost", 23324, 60, 500L)) {
             throw new IllegalStateException("cannot connect to Apex Rest Server");
@@ -180,25 +186,27 @@ public class TestRestServer {
         // trigger 10 POST & PUT events
         for (int i = 0; i < 10; i++) {
             postResponse = client.target("http://localhost:23324/apex/FirstConsumer/EventIn")
-                            .request("application/json").post(Entity.json(getEvent()));
+                .request("application/json").post(Entity.json(getEvent()));
             if (Response.Status.OK.getStatusCode() != postResponse.getStatus()) {
                 break;
             }
             putResponse = client.target("http://localhost:23324/apex/FirstConsumer/EventIn").request("application/json")
-                            .put(Entity.json(getEvent()));
+                .put(Entity.json(getEvent()));
 
             if (Response.Status.OK.getStatusCode() != putResponse.getStatus()) {
                 break;
             }
         }
 
-        final Response statResponse = client.target("http://localhost:23324/apex/FirstConsumer/Status")
-                        .request("application/json").get();
+        final Response statResponse =
+            client.target("http://localhost:23324/apex/FirstConsumer/Status").request("application/json").get();
 
         final String responseString = statResponse.readEntity(String.class);
 
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         assertEquals(Response.Status.OK.getStatusCode(), postResponse.getStatus());
         assertEquals(Response.Status.OK.getStatusCode(), putResponse.getStatus());
         assertEquals(Response.Status.OK.getStatusCode(), statResponse.getStatus());
@@ -226,7 +234,7 @@ public class TestRestServer {
         throws MessagingException, ApexException, IOException, InterruptedException {
         LOGGER.debug("testRestServerMultiInputs start");
         final String[] args =
-            { "-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEventMultiIn.json" };
+            {"-rfr", "target", "-c", "target/examples/config/SampleDomain/RESTServerJsonEventMultiIn.json"};
         final ApexMain apexMain = new ApexMain(args);
         if (!NetworkUtil.isTcpPortOpen("localhost", 23324, 60, 500L)) {
             throw new IllegalStateException("cannot connect to Apex Rest Server");
@@ -241,7 +249,7 @@ public class TestRestServer {
 
         for (int i = 0; i < 20; i++) {
             firstResponse = client.target("http://localhost:23324/apex/FirstConsumer/EventIn")
-                            .request("application/json").post(Entity.json(getEvent()));
+                .request("application/json").post(Entity.json(getEvent()));
 
             if (Response.Status.OK.getStatusCode() != firstResponse.getStatus()) {
                 break;
@@ -252,7 +260,7 @@ public class TestRestServer {
             firstJsonMap = new Gson().fromJson(firstResponseString, Map.class);
 
             secondResponse = client.target("http://localhost:23325/apex/SecondConsumer/EventIn")
-                            .request("application/json").post(Entity.json(getEvent()));
+                .request("application/json").post(Entity.json(getEvent()));
 
             if (Response.Status.OK.getStatusCode() != secondResponse.getStatus()) {
                 break;
@@ -265,6 +273,8 @@ public class TestRestServer {
 
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         assertEquals(Response.Status.OK.getStatusCode(), firstResponse.getStatus());
         assertEquals("org.onap.policy.apex.sample.events", firstJsonMap.get("nameSpace"));
         assertEquals("Test slogan for External Event0", firstJsonMap.get("TestSlogan"));
@@ -290,20 +300,21 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventProducerStandalone.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerStandalone.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
         System.setErr(stderr);
 
-        assertTrue(outString.contains(
-                        "the parameters \"host\", \"port\", and \"standalone\" are illegal on REST Server producer"));
+        assertTrue(outString
+            .contains("the parameters \"host\", \"port\", and \"standalone\" are illegal on REST Server producer"));
         LOGGER.debug("testRestServerProducerStandalone end");
     }
 
@@ -322,13 +333,14 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventProducerHost.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerHost.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
@@ -353,13 +365,14 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventProducerPort.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerPort.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
@@ -382,20 +395,21 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventConsumerStandaloneNoHost.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventConsumerStandaloneNoHost.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
         System.setErr(stderr);
 
         assertTrue(outString.contains("the parameters \"host\" and \"port\" must be defined for REST Server consumer "
-                        + "(FirstConsumer) in standalone mode"));
+            + "(FirstConsumer) in standalone mode"));
         LOGGER.debug("testRestServerConsumerStandaloneNoHost end");
     }
 
@@ -412,20 +426,21 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventConsumerStandaloneNoPort.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventConsumerStandaloneNoPort.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
         System.setErr(stderr);
 
         assertTrue(outString.contains("the parameters \"host\" and \"port\" must be defined for REST Server consumer "
-                        + "(FirstConsumer) in standalone mode"));
+            + "(FirstConsumer) in standalone mode"));
         LOGGER.debug("testRestServerConsumerStandaloneNoPort end");
     }
 
@@ -442,20 +457,21 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventProducerNotSync.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventProducerNotSync.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
         System.setErr(stderr);
 
-        assertTrue(outString.contains("REST Server producer (FirstProducer) must run in synchronous mode "
-                        + "with a REST Server consumer"));
+        assertTrue(outString.contains(
+            "REST Server producer (FirstProducer) must run in synchronous mode " + "with a REST Server consumer"));
         LOGGER.debug("testRestServerProducerNotSync end");
     }
 
@@ -472,21 +488,22 @@ public class TestRestServer {
         System.setOut(new PrintStream(outContent));
         System.setErr(new PrintStream(errContent));
 
-        final String[] args =
-            { "src/test/resources/prodcons/RESTServerJsonEventConsumerNotSync.json" };
+        final String[] args = {"src/test/resources/prodcons/RESTServerJsonEventConsumerNotSync.json"};
 
         final ApexMain apexMain = new ApexMain(args);
         ThreadUtilities.sleep(200);
         apexMain.shutdown();
 
+        await().atMost(10L, TimeUnit.SECONDS).until(() -> !apexMain.isAlive());
+
         final String outString = outContent.toString();
 
         System.setOut(stdout);
         System.setErr(stderr);
 
-        assertTrue(outString
-                        .contains("peer \"FirstConsumer for peered mode SYNCHRONOUS does not exist or is not defined "
-                                        + "with the same peered mode"));
+        assertTrue(
+            outString.contains("peer \"FirstConsumer for peered mode SYNCHRONOUS does not exist or is not defined "
+                + "with the same peered mode"));
         LOGGER.debug("testRestServerConsumerNotSync end");
     }
 
@@ -501,10 +518,10 @@ public class TestRestServer {
         final String nextEventName = "Event0" + rand.nextInt(2) + "00";
 
         final String eventString = "{\n" + "\"nameSpace\": \"org.onap.policy.apex.sample.events\",\n" + "\"name\": \""
-                        + nextEventName + "\",\n" + "\"version\": \"0.0.1\",\n" + "\"source\": \"REST_" + eventsSent++
-                        + "\",\n" + "\"target\": \"apex\",\n" + "\"TestSlogan\": \"Test slogan for External Event0\",\n"
-                        + "\"TestMatchCase\": " + nextMatchCase + ",\n" + "\"TestTimestamp\": "
-                        + System.currentTimeMillis() + ",\n" + "\"TestTemperature\": 9080.866\n" + "}";
+            + nextEventName + "\",\n" + "\"version\": \"0.0.1\",\n" + "\"source\": \"REST_" + eventsSent++ + "\",\n"
+            + "\"target\": \"apex\",\n" + "\"TestSlogan\": \"Test slogan for External Event0\",\n"
+            + "\"TestMatchCase\": " + nextMatchCase + ",\n" + "\"TestTimestamp\": " + System.currentTimeMillis() + ",\n"
+            + "\"TestTemperature\": 9080.866\n" + "}";
 
         return eventString;
     }
diff --git a/testsuites/integration/integration-uservice-test/src/test/resources/logback-test.xml b/testsuites/integration/integration-uservice-test/src/test/resources/logback-test.xml
new file mode 100644 (file)
index 0000000..fbe9ffc
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+   Copyright (C) 2016-2018 Ericsson. All rights reserved.
+   Modifications Copyright (C) 2020 Nordix Foundation.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  SPDX-License-Identifier: Apache-2.0
+  ============LICENSE_END=========================================================
+-->
+
+<configuration>
+    <contextName>Apex</contextName>
+    <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
+
+    <!-- USE FOR STD OUT ONLY -->
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <Pattern>%d %contextName [%t] %level %logger{36} - %msg%n</Pattern>
+        </encoder>
+    </appender>
+
+    <root level="INFO">
+        <appender-ref ref="STDOUT" />
+    </root>
+
+</configuration>
index fae8987..338c98f 100644 (file)
@@ -33,7 +33,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 8b77966..90f6c5b 100644 (file)
@@ -34,7 +34,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index fb79d65..fbe5d34 100644 (file)
@@ -33,7 +33,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 8a18879..d584762 100644 (file)
@@ -33,7 +33,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 65ddb25..ed6a1bb 100644 (file)
@@ -30,7 +30,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {
index 5da96ae..253008b 100644 (file)
@@ -41,7 +41,7 @@
             "carrierTechnologyParameters": {
                 "carrierTechnology": "FILE",
                 "parameters": {
-                    "fileName": "src/test/resources/events/EventsOut.json"
+                    "fileName": "target/EventsOut.json"
                 }
             },
             "eventProtocolParameters": {