summaryrefslogtreecommitdiffstats
path: root/services/services-engine/src
diff options
context:
space:
mode:
Diffstat (limited to 'services/services-engine/src')
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java200
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java51
2 files changed, 122 insertions, 129 deletions
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
index ab05dc7f0..de78bb0fe 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ContextParameterTests.java
@@ -1,19 +1,20 @@
/*-
* ============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=========================================================
*/
@@ -32,15 +33,14 @@ import org.onap.policy.common.parameters.ParameterException;
/**
* Test for an empty parameter file.
- *
+ *
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
public class ContextParameterTests {
@Test
- public void noParamsTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextNoParams.json" };
+ public void testNoParamsTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextNoParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -48,15 +48,14 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextNoParams.json\"\n"
- + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
- + "\"contextParameters\" entry", e.getMessage());
+ + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
+ + "\"contextParameters\" entry", e.getMessage());
}
}
@Test
- public void badParamsTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadParams.json" };
+ public void testBadParamsTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -64,16 +63,15 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from \"src/test/resources/parameters/serviceContextBadParams.json\""
- + "\n(ParameterRuntimeException):failed to deserialize the parameters for "
- + "\"contextParameters\" to parameter class "
- + "\"hello\"\njava.lang.ClassNotFoundException: hello", e.getMessage());
+ + "\n(ParameterRuntimeException):failed to deserialize the parameters for "
+ + "\"contextParameters\" to parameter class "
+ + "\"hello\"\njava.lang.ClassNotFoundException: hello", e.getMessage());
}
}
@Test
- public void badPluginParamNameTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadPluginNameParams.json" };
+ public void testBadPluginParamNameTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadPluginNameParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -81,36 +79,35 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadPluginNameParams.json\"\n"
- + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
- + "\"contextParameters\" entry", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadPluginNameParams.json\"\n"
+ + "(ParameterRuntimeException):could not find field \"parameterClassName\" in "
+ + "\"contextParameters\" entry", e.getMessage());
}
}
@Test
- public void badClassParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadClassParams.json" };
+ public void testBadClassParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
new ApexParameterHandler().getParameters(arguments);
fail("This test should throw an exception");
} catch (final ParameterException e) {
- assertEquals("error reading parameters from "
+ assertEquals(
+ "error reading parameters from "
+ "\"src/test/resources/parameters/serviceContextBadClassParams.json\""
+ "\n(ParameterRuntimeException):failed to deserialize "
+ "the parameters for \"contextParameters\""
+ " to parameter class \"java.lang.Integer\"\ncom.google.gson.JsonSyntaxException: "
+ "java.lang.IllegalStateException: Expected NUMBER but was BEGIN_OBJECT at path $",
- e.getMessage());
+ e.getMessage());
}
}
@Test
- public void badPluginClassTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadPluginClassParams.json" };
+ public void testBadPluginClassTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadPluginClassParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -118,121 +115,111 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadPluginClassParams.json\""
- + "\n(ClassCastException):org.onap.policy.apex.service.engine.parameters.dummyclasses."
- + "SuperDooperExecutorParameters"
- + " cannot be cast to org.onap.policy.apex.context.parameters.ContextParameters",
- e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadPluginClassParams.json\""
+ + "\n(ClassCastException):class org.onap.policy.apex.service.engine.parameters."
+ + "dummyclasses.SuperDooperExecutorParameters"
+ + " cannot be cast to class org.onap.policy.apex.context.parameters.ContextParameters (org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperExecutorParameters and org.onap.policy.apex.context.parameters.ContextParameters are in unnamed module of loader 'app')",
+ e.getMessage());
}
}
@Test
- public void okFlushParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextOKFlushParams.json" };
+ public void testOkFlushParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKFlushParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
+ .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getName());
assertEquals(123456, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
}
@Test
- public void okDefaultParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextOKDefaultParams.json" };
+ public void testOkDefaultParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKDefaultParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
+ .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getName());
assertEquals(300000, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
}
@Test
- public void okDistParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextOKDistParams.json" };
+ public void testOkDistParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKDistParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
+ .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.DistributorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters().getClass().getName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getDistributorParameters().getClass().getName());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
}
@Test
- public void okFullDefaultParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/goodParams.json" };
+ public void testOkFullDefaultParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
+ .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.DistributorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters().getClass().getName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getDistributorParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.LockManagerParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getLockManagerParameters().getClass().getName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getLockManagerParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.PersistorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getClass().getName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getPersistorParameters().getClass().getName());
assertEquals(300000, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
}
@Test
- public void okFullParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextOKFullParams.json" };
+ public void testOkFullParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextOKFullParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
- assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getName());
+ assertEquals("org.onap.policy.apex.context.parameters.ContextParameters", parameters
+ .getEngineServiceParameters().getEngineParameters().getContextParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.LockManagerParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getLockManagerParameters().getClass().getName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getLockManagerParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.PersistorParameters",
- parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getClass().getName());
+ parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
+ .getPersistorParameters().getClass().getName());
assertEquals(123456, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getFlushPeriod());
+ .getPersistorParameters().getFlushPeriod());
- final SuperDooperDistributorParameters infinispanParameters = (SuperDooperDistributorParameters) parameters
- .getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters();
+ final SuperDooperDistributorParameters infinispanParameters =
+ (SuperDooperDistributorParameters) parameters.getEngineServiceParameters().getEngineParameters()
+ .getContextParameters().getDistributorParameters();
assertEquals("org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperDistributorParameters",
- infinispanParameters.getClass().getName());
+ infinispanParameters.getClass().getName());
assertEquals("my/lovely/configFile.xml", infinispanParameters.getConfigFile());
assertEquals("holy/stone.xml", infinispanParameters.getJgroupsFile());
assertEquals(false, infinispanParameters.isPreferIPv4Stack());
@@ -244,9 +231,8 @@ public class ContextParameterTests {
}
@Test
- public void badClassDistParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadClassDistParams.json" };
+ public void testBadClassDistParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassDistParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -254,17 +240,18 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadClassDistParams.json\"\n"
- + "(ClassCastException):"
- + "org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
- + " org.onap.policy.apex.context.parameters.DistributorParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadClassDistParams.json\"\n"
+ + "(ClassCastException):class "
+ + "org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to class"
+ + " org.onap.policy.apex.context.parameters.DistributorParameters (org.onap.policy.apex.context."
+ + "parameters.ContextParameters and org.onap.policy.apex.context.parameters.DistributorParameters "
+ + "are in unnamed module of loader 'app')", e.getMessage());
}
}
@Test
- public void badClassLockParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadClassLockParams.json" };
+ public void testBadClassLockParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassLockParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -272,17 +259,18 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadClassLockParams.json\"\n"
- + "(ClassCastException):"
- + "org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
- + " org.onap.policy.apex.context.parameters.LockManagerParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadClassLockParams.json\"\n"
+ + "(ClassCastException):class "
+ + "org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to class "
+ + "org.onap.policy.apex.context.parameters.LockManagerParameters (org.onap.policy.apex.context."
+ + "parameters.ContextParameters and org.onap.policy.apex.context.parameters.LockManagerParameters "
+ + "are in unnamed module of loader 'app')", e.getMessage());
}
}
@Test
- public void badClassPersistParamTest() {
- final String[] args =
- { "-c", "src/test/resources/parameters/serviceContextBadClassPersistParams.json" };
+ public void testBadClassPersistParamTest() {
+ final String[] args = {"-c", "src/test/resources/parameters/serviceContextBadClassPersistParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
try {
@@ -290,10 +278,12 @@ public class ContextParameterTests {
fail("This test should throw an exception");
} catch (final ParameterException e) {
assertEquals("error reading parameters from "
- + "\"src/test/resources/parameters/serviceContextBadClassPersistParams.json\"\n"
- + "(ClassCastException):"
- + "org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to"
- + " org.onap.policy.apex.context.parameters.PersistorParameters", e.getMessage());
+ + "\"src/test/resources/parameters/serviceContextBadClassPersistParams.json\"\n"
+ + "(ClassCastException):class "
+ + "org.onap.policy.apex.context.parameters.ContextParameters cannot be cast to class "
+ + "org.onap.policy.apex.context.parameters.PersistorParameters (org.onap.policy.apex.context."
+ + "parameters.ContextParameters and org.onap.policy.apex.context.parameters.PersistorParameters "
+ + "are in unnamed module of loader 'app')", e.getMessage());
}
}
}
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
index 20d54ae3e..df1960aa0 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/parameters/ProducerConsumerTests.java
@@ -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.
@@ -39,7 +39,7 @@ import org.onap.policy.common.parameters.ParameterException;
*/
public class ProducerConsumerTests {
@Test
- public void goodParametersTest() {
+ public void testGoodParametersTest() {
final String[] args = {"-c", "src/test/resources/parameters/goodParams.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -73,7 +73,7 @@ public class ProducerConsumerTests {
}
@Test
- public void noCarrierTechnology() {
+ public void testNoCarrierTechnology() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsNoCT.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -94,7 +94,7 @@ public class ProducerConsumerTests {
}
@Test
- public void noEventProcol() {
+ public void testNoEventProcol() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsNoEP.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -124,7 +124,7 @@ public class ProducerConsumerTests {
}
@Test
- public void noCarrierTechnologyParClass() {
+ public void testNoCarrierTechnologyParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsNoCTParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -139,7 +139,7 @@ public class ProducerConsumerTests {
}
@Test
- public void mismatchCarrierTechnologyParClass() {
+ public void testMismatchCarrierTechnologyParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsMismatchCTParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -158,7 +158,7 @@ public class ProducerConsumerTests {
}
@Test
- public void wrongTypeCarrierTechnologyParClass() {
+ public void testWrongTypeCarrierTechnologyParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsWrongTypeCTParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -166,19 +166,20 @@ public class ProducerConsumerTests {
new ApexParameterHandler().getParameters(arguments);
fail("This test should throw an exception");
} catch (final ParameterException e) {
- assertEquals(
- "error reading parameters from "
- + "\"src/test/resources/parameters/prodConsWrongTypeCTParClass.json\"\n"
- + "(ParameterRuntimeException):could not create default parameters for carrier technology "
- + "\"SUPER_DOOPER\"\n" + "org.onap.policy.apex.service.engine.parameters.dummyclasses."
- + "SuperTokenDelimitedEventProtocolParameters cannot be cast to "
- + "org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters",
- e.getMessage());
+ assertEquals("error reading parameters from "
+ + "\"src/test/resources/parameters/prodConsWrongTypeCTParClass.json\"\n"
+ + "(ParameterRuntimeException):could not create default parameters for carrier technology "
+ + "\"SUPER_DOOPER\"\n" + "class org.onap.policy.apex.service.engine.parameters.dummyclasses."
+ + "SuperTokenDelimitedEventProtocolParameters cannot be cast to class "
+ + "org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters (org.onap."
+ + "policy.apex.service.engine.parameters.dummyclasses.SuperTokenDelimitedEventProtocolParameters "
+ + "and org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters are in"
+ + " unnamed module of loader 'app')", e.getMessage());
}
}
@Test
- public void okFileNameCarrierTechnology() {
+ public void testOkFileNameCarrierTechnology() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsOKFileName.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -196,7 +197,7 @@ public class ProducerConsumerTests {
}
@Test
- public void badFileNameCarrierTechnology() {
+ public void testBadFileNameCarrierTechnology() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsBadFileName.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -222,7 +223,7 @@ public class ProducerConsumerTests {
}
@Test
- public void badEventProtocolParClass() {
+ public void testBadEventProtocolParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsBadEPParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -241,7 +242,7 @@ public class ProducerConsumerTests {
}
@Test
- public void noEventProtocolParClass() {
+ public void testNoEventProtocolParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsNoEPParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -256,7 +257,7 @@ public class ProducerConsumerTests {
}
@Test
- public void mismatchEventProtocolParClass() {
+ public void testMismatchEventProtocolParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsMismatchEPParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -277,7 +278,7 @@ public class ProducerConsumerTests {
}
@Test
- public void wrongTypeEventProtocolParClass() {
+ public void testWrongTypeEventProtocolParClass() {
final String[] args = {"-c", "src/test/resources/parameters/prodConsWrongTypeEPParClass.json"};
final ApexCommandLineArguments arguments = new ApexCommandLineArguments(args);
@@ -288,10 +289,12 @@ public class ProducerConsumerTests {
assertEquals("error reading parameters from "
+ "\"src/test/resources/parameters/prodConsWrongTypeEPParClass.json\"\n"
+ "(ParameterRuntimeException):could not create default parameters for event protocol "
- + "\"SUPER_TOK_DEL\"\n" + "org.onap.policy.apex.service.engine."
+ + "\"SUPER_TOK_DEL\"\n" + "class org.onap.policy.apex.service.engine."
+ "parameters.dummyclasses.SuperDooperCarrierTechnologyParameters "
- + "cannot be cast to org.onap.policy.apex.service."
- + "parameters.eventprotocol.EventProtocolParameters", e.getMessage());
+ + "cannot be cast to class org.onap.policy.apex.service."
+ + "parameters.eventprotocol.EventProtocolParameters (org.onap.policy.apex.service.engine.parameters"
+ + ".dummyclasses.SuperDooperCarrierTechnologyParameters and org.onap.policy.apex.service.parameters"
+ + ".eventprotocol.EventProtocolParameters are in unnamed module of loader 'app')", e.getMessage());
}
}
}