parameters = parser.parse(args);
if (parameters.isHelpSet()) {
- parser.help(ApexCommandLineEditorMain.class.getCanonicalName());
+ parser.help(ApexCommandLineEditorMain.class.getName());
return;
}
parameters.validate();
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
-
import org.onap.policy.apex.context.parameters.SchemaHelperParameters;
import org.onap.policy.common.parameters.GroupValidationResult;
*/
public JavaSchemaHelperParameters() {
this.setName("Java");
- this.setSchemaHelperPluginClass(JavaSchemaHelper.class.getCanonicalName());
+ this.setSchemaHelperPluginClass(JavaSchemaHelper.class.getName());
}
-
+
/**
* Get the JSON adapters.
- *
+ *
* @return the JSON adapters
*/
public Map<String, JavaSchemaHelperJsonAdapterParameters> getJsonAdapters() {
/**
* Set JSON adapters for the schema helper.
- *
+ *
* @param jsonAdapters the JSON adapters
*/
public void setJsonAdapters(Map<String, JavaSchemaHelperJsonAdapterParameters> jsonAdapters) {
*/
public class DistributorParameters implements ParameterGroup {
/** The default distributor makes context albums available to all threads in a single JVM. */
- public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JvmLocalDistributor.class.getCanonicalName();
+ public static final String DEFAULT_DISTRIBUTOR_PLUGIN_CLASS = JvmLocalDistributor.class.getName();
private String name;
private String pluginClass = DEFAULT_DISTRIBUTOR_PLUGIN_CLASS;
/**
* The default lock manager can lock context album instance across all threads in a single JVM.
*/
- public static final String DEFAULT_LOCK_MANAGER_PLUGIN_CLASS = JvmLocalLockManager.class.getCanonicalName();
+ public static final String DEFAULT_LOCK_MANAGER_PLUGIN_CLASS = JvmLocalLockManager.class.getName();
private String name;
private String pluginClass = DEFAULT_LOCK_MANAGER_PLUGIN_CLASS;
assertEquals(fieldKey, field.getKey());
assertEquals("MyField", field.getName());
assertEquals("org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelper",
- field.getSchemaHelper().getClass().getCanonicalName());
+ field.getSchemaHelper().getClass().getName());
assertEquals(123, field.getAssignableValue());
assertEquals("EnField [axField=AxField:(key=AxReferenceKey:(parentKeyName=Parent,parentKeyVersion=0.0.1,"
+ "parentLocalName=MyParent,localName=MyField),fieldSchemaKey=AxArtifactKey:"
Assertions.argumentNotNull(message, "message may not be null");
this.observedKey = observedKey;
- this.observedClass = observedClass.getCanonicalName();
+ this.observedClass = observedClass.getName();
this.validationResult = validationResult;
this.message = message;
}
assertEquals(AxValidationResult.ValidationResult.INVALID, result.getMessageList().get(3).getValidationResult());
assertEquals("Some message", result.getMessageList().get(3).getMessage());
- assertEquals(AxArtifactKey.class.getCanonicalName(), result.getMessageList().get(3).getObservedClass());
+ assertEquals(AxArtifactKey.class.getName(), result.getMessageList().get(3).getObservedClass());
assertEquals(AxArtifactKey.getNullKey(), result.getMessageList().get(3).getObservedKey());
}
}
public static final String JMS_CARRIER_TECHNOLOGY_LABEL = "JMS";
/** The producer plugin class for the JMS carrier technology. */
- public static final String JMS_EVENT_PRODUCER_PLUGIN_CLASS = ApexJmsProducer.class.getCanonicalName();
+ public static final String JMS_EVENT_PRODUCER_PLUGIN_CLASS = ApexJmsProducer.class.getName();
/** The consumer plugin class for the JMS carrier technology. */
- public static final String JMS_EVENT_CONSUMER_PLUGIN_CLASS = ApexJmsConsumer.class.getCanonicalName();
+ public static final String JMS_EVENT_CONSUMER_PLUGIN_CLASS = ApexJmsConsumer.class.getName();
// @formatter:off
public static final String JMS_CARRIER_TECHNOLOGY_LABEL = "JMS";
public static final String JMS_EVENT_PRODUCER_PLUGIN_CLASS =
- ApexJmsProducer.class.getCanonicalName();
+ ApexJmsProducer.class.getName();
public static final String JMS_EVENT_CONSUMER_PLUGIN_CLASS =
- ApexJmsConsumer.class.getCanonicalName();
+ ApexJmsConsumer.class.getName();
private static final String DEFAULT_CONNECTION_FACTORY = "jms/RemoteConnectionFactory";
private static final String DEFAULT_INITIAL_CTXT_FACTORY =
public static final String KAFKA_CARRIER_TECHNOLOGY_LABEL = "KAFKA";
/** The producer plugin class for the Kafka carrier technology. */
- public static final String KAFKA_EVENT_PRODUCER_PLUGIN_CLASS = ApexKafkaProducer.class.getCanonicalName();
+ public static final String KAFKA_EVENT_PRODUCER_PLUGIN_CLASS = ApexKafkaProducer.class.getName();
/** The consumer plugin class for the Kafka carrier technology. */
- public static final String KAFKA_EVENT_CONSUMER_PLUGIN_CLASS = ApexKafkaConsumer.class.getCanonicalName();
+ public static final String KAFKA_EVENT_CONSUMER_PLUGIN_CLASS = ApexKafkaConsumer.class.getName();
// Repeated strings in messages
private static final String SPECIFY_AS_STRING_MESSAGE = "not specified, must be specified as a string";
private static final String[] DEFAULT_CONS_TOPICLIST = {"apex-in"};
private static final String DEFAULT_STRING_SERZER = "org.apache.kafka.common.serialization.StringSerializer";
private static final String DEFAULT_STRING_DESZER = "org.apache.kafka.common.serialization.StringDeserializer";
- private static final String DEFAULT_PARTITIONR_CLASS = DefaultPartitioner.class.getCanonicalName();
+ private static final String DEFAULT_PARTITIONR_CLASS = DefaultPartitioner.class.getName();
// Parameter property map tokens
private static final String PROPERTY_BOOTSTRAP_SERVERS = "bootstrap.servers";
public static final String RESTCLIENT_CARRIER_TECHNOLOGY_LABEL = "RESTCLIENT";
/** The producer plugin class for the REST carrier technology. */
- public static final String RESTCLIENT_EVENT_PRODUCER_PLUGIN_CLASS = ApexRestClientProducer.class.getCanonicalName();
+ public static final String RESTCLIENT_EVENT_PRODUCER_PLUGIN_CLASS = ApexRestClientProducer.class.getName();
/** The consumer plugin class for the REST carrier technology. */
- public static final String RESTCLIENT_EVENT_CONSUMER_PLUGIN_CLASS = ApexRestClientConsumer.class.getCanonicalName();
+ public static final String RESTCLIENT_EVENT_CONSUMER_PLUGIN_CLASS = ApexRestClientConsumer.class.getName();
// Commonly occurring strings
private static final String HTTP_HEADERS = "httpHeaders";
public static final String RESTSERVER_CARRIER_TECHNOLOGY_LABEL = "RESTSERVER";
/** The producer plugin class for the REST carrier technology. */
- public static final String RESTSERVER_EVENT_PRODUCER_PLUGIN_CLASS = ApexRestServerProducer.class.getCanonicalName();
+ public static final String RESTSERVER_EVENT_PRODUCER_PLUGIN_CLASS = ApexRestServerProducer.class.getName();
/** The consumer plugin class for the REST carrier technology. */
- public static final String RESTSERVER_EVENT_CONSUMER_PLUGIN_CLASS = ApexRestServerConsumer.class.getCanonicalName();
+ public static final String RESTSERVER_EVENT_CONSUMER_PLUGIN_CLASS = ApexRestServerConsumer.class.getName();
// REST server parameters
private boolean standalone = false;
public static final String WEB_SCOKET_CARRIER_TECHNOLOGY_LABEL = "WEBSOCKET";
/** The producer plugin class for the web socket carrier technology. */
- public static final String WEB_SCOKET_EVENT_PRODUCER_PLUGIN_CLASS = ApexWebSocketProducer.class.getCanonicalName();
+ public static final String WEB_SCOKET_EVENT_PRODUCER_PLUGIN_CLASS = ApexWebSocketProducer.class.getName();
/** The consumer plugin class for the web socket carrier technology. */
- public static final String KWEB_SCOKET_EVENT_CONSUMER_PLUGIN_CLASS = ApexWebSocketConsumer.class.getCanonicalName();
+ public static final String KWEB_SCOKET_EVENT_CONSUMER_PLUGIN_CLASS = ApexWebSocketConsumer.class.getName();
// Default parameter values
private static final String DEFAULT_HOST = "localhost";
this.setLabel(JMS_OBJECT_EVENT_PROTOCOL_LABEL);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(Apex2JmsObjectEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(Apex2JmsObjectEventConverter.class.getName());
}
/**
this.setLabel(JMS_TEXT_EVENT_PROTOCOL_LABEL);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(Apex2JmsTextEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(Apex2JmsTextEventConverter.class.getName());
}
}
this.setStartDelimiterToken(XML_TEXT_DELIMITER_TOKEN);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(Apex2XmlEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(Apex2XmlEventConverter.class.getName());
}
}
this.setEndDelimiterToken(YAML_END_TEXT_DELIMITER_TOKEN);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(Apex2YamlEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(Apex2YamlEventConverter.class.getName());
}
/**
* Constructor that sets the abstract implementation classes.
*/
public JavaExecutorParameters() {
- this.setTaskExecutorPluginClass(JavaTaskExecutor.class.getCanonicalName());
- this.setTaskSelectionExecutorPluginClass(JavaTaskSelectExecutor.class.getCanonicalName());
- this.setStateFinalizerExecutorPluginClass(JavaStateFinalizerExecutor.class.getCanonicalName());
+ this.setTaskExecutorPluginClass(JavaTaskExecutor.class.getName());
+ this.setTaskSelectionExecutorPluginClass(JavaTaskSelectExecutor.class.getName());
+ this.setStateFinalizerExecutorPluginClass(JavaStateFinalizerExecutor.class.getName());
}
}
* Constructor that sets the abstract implementation classes.
*/
public JavascriptExecutorParameters() {
- this.setTaskExecutorPluginClass(JavascriptTaskExecutor.class.getCanonicalName());
- this.setTaskSelectionExecutorPluginClass(JavascriptTaskSelectExecutor.class.getCanonicalName());
- this.setStateFinalizerExecutorPluginClass(JavascriptStateFinalizerExecutor.class.getCanonicalName());
+ this.setTaskExecutorPluginClass(JavascriptTaskExecutor.class.getName());
+ this.setTaskSelectionExecutorPluginClass(JavascriptTaskSelectExecutor.class.getName());
+ this.setStateFinalizerExecutorPluginClass(JavascriptStateFinalizerExecutor.class.getName());
}
}
* Constructor that sets the abstract implementation classes.
*/
public JrubyExecutorParameters() {
- this.setTaskExecutorPluginClass(JrubyTaskExecutor.class.getCanonicalName());
- this.setTaskSelectionExecutorPluginClass(JrubyTaskSelectExecutor.class.getCanonicalName());
- this.setStateFinalizerExecutorPluginClass(JrubyStateFinalizerExecutor.class.getCanonicalName());
+ this.setTaskExecutorPluginClass(JrubyTaskExecutor.class.getName());
+ this.setTaskSelectionExecutorPluginClass(JrubyTaskSelectExecutor.class.getName());
+ this.setStateFinalizerExecutorPluginClass(JrubyStateFinalizerExecutor.class.getName());
}
}
* Constructor that sets the abstract implementation classes.
*/
public JythonExecutorParameters() {
- this.setTaskExecutorPluginClass(JythonTaskExecutor.class.getCanonicalName());
- this.setTaskSelectionExecutorPluginClass(JythonTaskSelectExecutor.class.getCanonicalName());
- this.setStateFinalizerExecutorPluginClass(JythonStateFinalizerExecutor.class.getCanonicalName());
+ this.setTaskExecutorPluginClass(JythonTaskExecutor.class.getName());
+ this.setTaskSelectionExecutorPluginClass(JythonTaskSelectExecutor.class.getName());
+ this.setStateFinalizerExecutorPluginClass(JythonStateFinalizerExecutor.class.getName());
}
}
* Constructor that sets the abstract implementation classes.
*/
public MvelExecutorParameters() {
- this.setTaskExecutorPluginClass(MvelTaskExecutor.class.getCanonicalName());
- this.setTaskSelectionExecutorPluginClass(MvelTaskSelectExecutor.class.getCanonicalName());
- this.setStateFinalizerExecutorPluginClass(MvelStateFinalizerExecutor.class.getCanonicalName());
+ this.setTaskExecutorPluginClass(MvelTaskExecutor.class.getName());
+ this.setTaskSelectionExecutorPluginClass(MvelTaskSelectExecutor.class.getName());
+ this.setStateFinalizerExecutorPluginClass(MvelStateFinalizerExecutor.class.getName());
}
}
*/
@Before
public void setup() throws ApexException {
- daoParameters.setPluginClass(EclipselinkApexDao.class.getCanonicalName());
+ daoParameters.setPluginClass(EclipselinkApexDao.class.getName());
daoParameters.setPersistenceUnit("DAOTest");
eclipselinkApexDao = new EclipselinkApexDao();
eclipselinkApexDao.init(daoParameters);
this.setLabel(eventProtocolLabel);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(Apex2ApexEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(Apex2ApexEventConverter.class.getName());
}
}
/** The producer plugin class for the EVENT_REQUESTOR carrier technology. */
public static final String EVENT_REQUESTOR_EVENT_PRODUCER_PLUGIN_CLASS =
- EventRequestorProducer.class.getCanonicalName();
+ EventRequestorProducer.class.getName();
/** The consumer plugin class for the EVENT_REQUESTOR carrier technology. */
public static final String EVENT_REQUESTOR_EVENT_CONSUMER_PLUGIN_CLASS =
- EventRequestorConsumer.class.getCanonicalName();
+ EventRequestorConsumer.class.getName();
// @formatter:on
/**
public static final String FILE_CARRIER_TECHNOLOGY_LABEL = "FILE";
/** The producer plugin class for the FILE carrier technology. */
- public static final String FILE_EVENT_PRODUCER_PLUGIN_CLASS = ApexFileEventProducer.class.getCanonicalName();
+ public static final String FILE_EVENT_PRODUCER_PLUGIN_CLASS = ApexFileEventProducer.class.getName();
/** The consumer plugin class for the FILE carrier technology. */
- public static final String FILE_EVENT_CONSUMER_PLUGIN_CLASS = ApexFileEventConsumer.class.getCanonicalName();
+ public static final String FILE_EVENT_CONSUMER_PLUGIN_CLASS = ApexFileEventConsumer.class.getName();
// Recurring strings
private static final String FILE_NAME_TOKEN = "fileName";
this.setEndChar(JSON_TEXT_BLOCK_END_DELIMITER);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(Apex2JsonEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(Apex2JsonEventConverter.class.getName());
}
/*
* (non-Javadoc)
- *
+ *
* @see org.onap.policy.common.parameters.ParameterGroup#getName()
*/
@Override
}
if (commandLine.hasOption('h')) {
- return help(ApexMain.class.getCanonicalName());
+ return help(ApexMain.class.getName());
}
if (commandLine.hasOption('v')) {
// Built in technology parameters
private static final Map<String, String> BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP = new HashMap<>();
-
+
static {
BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP.put("FILE",
- FileCarrierTechnologyParameters.class.getCanonicalName());
+ FileCarrierTechnologyParameters.class.getName());
BUILT_IN_CARRIER_TECHNOLOGY_PARMETER_CLASS_MAP.put("EVENT_REQUESTOR",
- EventRequestorCarrierTechnologyParameters.class.getCanonicalName());
+ EventRequestorCarrierTechnologyParameters.class.getName());
}
/*
// Built in event protocol parameters
private static final Map<String, String> BUILT_IN_EVENT_PROTOCOL_PARMETER_CLASS_MAP = new HashMap<>();
-
+
static {
- BUILT_IN_EVENT_PROTOCOL_PARMETER_CLASS_MAP.put("JSON", JsonEventProtocolParameters.class.getCanonicalName());
- BUILT_IN_EVENT_PROTOCOL_PARMETER_CLASS_MAP.put("APEX", ApexEventProtocolParameters.class.getCanonicalName());
+ BUILT_IN_EVENT_PROTOCOL_PARMETER_CLASS_MAP.put("JSON", JsonEventProtocolParameters.class.getName());
+ BUILT_IN_EVENT_PROTOCOL_PARMETER_CLASS_MAP.put("APEX", ApexEventProtocolParameters.class.getName());
}
/*
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getCanonicalName());
+ .getClass().getName());
assertEquals(123456, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
.getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getCanonicalName());
+ .getClass().getName());
assertEquals(300000, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
.getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getCanonicalName());
+ .getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.DistributorParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters().getClass().getCanonicalName());
+ .getDistributorParameters().getClass().getName());
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getCanonicalName());
+ .getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.DistributorParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getDistributorParameters().getClass().getCanonicalName());
+ .getDistributorParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.LockManagerParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getLockManagerParameters().getClass().getCanonicalName());
+ .getLockManagerParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.PersistorParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getClass().getCanonicalName());
+ .getPersistorParameters().getClass().getName());
assertEquals(300000, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
.getPersistorParameters().getFlushPeriod());
} catch (final ParameterException e) {
final ApexParameters parameters = new ApexParameterHandler().getParameters(arguments);
assertEquals("org.onap.policy.apex.context.parameters.ContextParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getClass().getCanonicalName());
+ .getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.LockManagerParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getLockManagerParameters().getClass().getCanonicalName());
+ .getLockManagerParameters().getClass().getName());
assertEquals("org.onap.policy.apex.context.parameters.PersistorParameters",
parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
- .getPersistorParameters().getClass().getCanonicalName());
+ .getPersistorParameters().getClass().getName());
assertEquals(123456, parameters.getEngineServiceParameters().getEngineParameters().getContextParameters()
.getPersistorParameters().getFlushPeriod());
.getEngineServiceParameters().getEngineParameters().getContextParameters()
.getDistributorParameters();
assertEquals("org.onap.policy.apex.service.engine.parameters.dummyclasses.SuperDooperDistributorParameters",
- infinispanParameters.getClass().getCanonicalName());
+ infinispanParameters.getClass().getName());
assertEquals("my/lovely/configFile.xml", infinispanParameters.getConfigFile());
assertEquals("holy/stone.xml", infinispanParameters.getJgroupsFile());
assertEquals(false, infinispanParameters.isPreferIPv4Stack());
assertEquals(19, parameters.getEngineServiceParameters().getInstanceCount());
assertEquals(65522, parameters.getEngineServiceParameters().getDeploymentPort());
assertTrue(parameters.getEngineServiceParameters().getPolicyModelFileName()
- .endsWith("/src/test/resources/policymodels/SmallModel.json"));
+ .endsWith("policymodels/SmallModel.json"));
} catch (final ParameterException e) {
fail("This test should not throw any exception: " + e.getMessage());
}
.getCarrierTechnologyParameters().getLabel());
assertEquals("FILE", parameters.getEventOutputParameters().get("MyOtherProducer")
.getCarrierTechnologyParameters().getLabel());
- assertEquals(ApexFileEventProducer.class.getCanonicalName(), parameters.getEventOutputParameters()
+ assertEquals(ApexFileEventProducer.class.getName(), parameters.getEventOutputParameters()
.get("MyOtherProducer").getCarrierTechnologyParameters().getEventProducerPluginClass());
- assertEquals(ApexFileEventConsumer.class.getCanonicalName(), parameters.getEventOutputParameters()
+ assertEquals(ApexFileEventConsumer.class.getName(), parameters.getEventOutputParameters()
.get("MyOtherProducer").getCarrierTechnologyParameters().getEventConsumerPluginClass());
assertEquals("JSON",
parameters.getEventOutputParameters().get("FirstProducer").getEventProtocolParameters().getLabel());
.getEventProtocolParameters().getLabel());
assertEquals("SUPER_TOK_DEL", parameters.getEventInputParameters().get("MySuperDooperConsumer1")
.getEventProtocolParameters().getLabel());
- assertEquals(ApexFileEventProducer.class.getCanonicalName(), parameters.getEventInputParameters()
+ assertEquals(ApexFileEventProducer.class.getName(), parameters.getEventInputParameters()
.get("TheFileConsumer1").getCarrierTechnologyParameters().getEventProducerPluginClass());
- assertEquals(ApexFileEventConsumer.class.getCanonicalName(), parameters.getEventInputParameters()
+ assertEquals(ApexFileEventConsumer.class.getName(), parameters.getEventInputParameters()
.get("TheFileConsumer1").getCarrierTechnologyParameters().getEventConsumerPluginClass());
- assertEquals(SuperDooperEventProducer.class.getCanonicalName(), parameters.getEventInputParameters()
+ assertEquals(SuperDooperEventProducer.class.getName(), parameters.getEventInputParameters()
.get("MySuperDooperConsumer1").getCarrierTechnologyParameters().getEventProducerPluginClass());
- assertEquals(SuperDooperEventSubscriber.class.getCanonicalName(), parameters.getEventInputParameters()
+ assertEquals(SuperDooperEventSubscriber.class.getName(), parameters.getEventInputParameters()
.get("MySuperDooperConsumer1").getCarrierTechnologyParameters().getEventConsumerPluginClass());
} catch (final ParameterException e) {
fail("This test should not throw an exception");
this.setStartDelimiterToken(SUPER_TOKEN_DELIMITER);
// Set the event protocol plugin class
- this.setEventProtocolPluginClass(SuperTokenDelimitedEventConverter.class.getCanonicalName());
+ this.setEventProtocolPluginClass(SuperTokenDelimitedEventConverter.class.getName());
}
}
}
String status = esImpl.getStatus(esImpl.getEngineKeys().iterator().next());
- assertEquals("{\n \"apexEngineModel\" :", status.substring(0, 24));
+ assertTrue(status.contains("\n \"apexEngineModel\" :"));
assertFalse(esImpl.isStarted());
assertFalse(esImpl.isStarted(null));
assertEquals(AxEngineState.EXECUTING, esImpl.getState());
String status = esImpl.getStatus(esImpl.getEngineKeys().iterator().next());
- assertEquals("{\n \"apexEngineModel\" :", status.substring(0, 24));
-
+ assertTrue(status.contains("\n \"apexEngineModel\" :"));
assertTrue(esImpl.isStarted());
assertTrue(esImpl.isStarted(esImpl.getEngineKeys().iterator().next()));
assertFalse(esImpl.isStopped());
}
if (commandLine.hasOption('h')) {
- return help(Main.class.getCanonicalName());
+ return help(Main.class.getName());
}
if (commandLine.hasOption('v')) {
servers = HttpServletServer.factory.build(getServerProperties());
for (final HttpServletServer server : servers) {
if (server.isAaf()) {
- server.addFilterClass(null, ApexStarterAafFilter.class.getCanonicalName());
+ server.addFilterClass(null, ApexStarterAafFilter.class.getName());
}
server.start();
}
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_PORT_SUFFIX,
Integer.toString(restServerParameters.getPort()));
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX,
- HealthCheckRestControllerV1.class.getCanonicalName());
+ HealthCheckRestControllerV1.class.getName());
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, "false");
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, "true");
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX,
SampleDomainModelSaver.main(null);
fail("test should throw an exception");
} catch (Exception exc) {
- assertEquals("java.lang.NullPointerException", exc.getClass().getCanonicalName());
+ assertEquals("java.lang.NullPointerException", exc.getClass().getName());
}
String[] args0 =
logger.debug("Running testConcurrentContextJVMLocalVarSet test . . .");
final ContextParameters contextParameters = new ContextParameters();
- contextParameters.getLockManagerParameters().setPluginClass(JvmLocalLockManager.class.getCanonicalName());
+ contextParameters.getLockManagerParameters().setPluginClass(JvmLocalLockManager.class.getName());
setContextParmetersInParameterService(contextParameters);
final ConfigrationProvider configrationProvider = getConfigrationProvider("JVMLocalVarSet",
logger.debug("Running testConcurrentContextMultiJVMNoLock test . . .");
final ContextParameters contextParameters = new ContextParameters();
- contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getCanonicalName());
- contextParameters.getLockManagerParameters().setPluginClass(JvmLocalLockManager.class.getCanonicalName());
+ contextParameters.getDistributorParameters().setPluginClass(JvmLocalDistributor.class.getName());
+ contextParameters.getLockManagerParameters().setPluginClass(JvmLocalLockManager.class.getName());
setContextParmetersInParameterService(contextParameters);
final ConfigrationProvider configrationProvider = getConfigrationProvider("testConcurrentContextMultiJVMNoLock",
final ContextParameters contextParameters = new ContextParameters();
contextParameters.getDistributorParameters().setPluginClass(DEFAULT_DISTRIBUTOR_PLUGIN_CLASS);
- contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getCanonicalName());
+ contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getName());
setContextParmetersInParameterService(contextParameters);
final ConfigrationProvider configrationProvider = getConfigrationProvider("HazelcastLock",
distributorParameters.setPluginClass(DEFAULT_DISTRIBUTOR_PLUGIN_CLASS);
final CuratorLockManagerParameters curatorParameters = new CuratorLockManagerParameters();
- curatorParameters.setPluginClass(CuratorLockManager.class.getCanonicalName());
+ curatorParameters.setPluginClass(CuratorLockManager.class.getName());
curatorParameters.setZookeeperAddress(ZOOKEEPER_ADDRESS + ":" + zookeeperPort);
contextParameters.setLockManagerParameters(curatorParameters);
setContextParmetersInParameterService(contextParameters);
final ContextParameters contextParameters = new ContextParameters();
final DistributorParameters distributorParameters = contextParameters.getDistributorParameters();
- distributorParameters.setPluginClass(HazelcastContextDistributor.class.getCanonicalName());
- contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getCanonicalName());
+ distributorParameters.setPluginClass(HazelcastContextDistributor.class.getName());
+ contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getName());
setContextParmetersInParameterService(contextParameters);
final ConfigrationProvider configrationProvider = getConfigrationProvider("HazelcastMultiHazelcastlock",
final ContextParameters contextParameters = new ContextParameters();
final InfinispanDistributorParameters infinispanParameters = new InfinispanDistributorParameters();
- infinispanParameters.setPluginClass(InfinispanContextDistributor.class.getCanonicalName());
+ infinispanParameters.setPluginClass(InfinispanContextDistributor.class.getName());
infinispanParameters.setConfigFile("infinispan/infinispan-context-test.xml");
contextParameters.setDistributorParameters(infinispanParameters);
- contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getCanonicalName());
+ contextParameters.getLockManagerParameters().setPluginClass(HazelcastLockManager.class.getName());
setContextParmetersInParameterService(contextParameters);
final ConfigrationProvider configrationProvider = getConfigrationProvider("InfinispanMultiHazelcastlock",
startZookeeperServer();
final InfinispanDistributorParameters infinispanParameters = new InfinispanDistributorParameters();
- infinispanParameters.setPluginClass(InfinispanContextDistributor.class.getCanonicalName());
+ infinispanParameters.setPluginClass(InfinispanContextDistributor.class.getName());
infinispanParameters.setConfigFile("infinispan/infinispan-context-test.xml");
contextParameters.setDistributorParameters(infinispanParameters);
final CuratorLockManagerParameters curatorParameters = new CuratorLockManagerParameters();
- curatorParameters.setPluginClass(CuratorLockManager.class.getCanonicalName());
+ curatorParameters.setPluginClass(CuratorLockManager.class.getName());
curatorParameters.setZookeeperAddress(ZOOKEEPER_ADDRESS + ":" + zookeeperPort);
contextParameters.setLockManagerParameters(curatorParameters);
setContextParmetersInParameterService(contextParameters);
startZookeeperServer();
contextParameters.getDistributorParameters()
- .setPluginClass(HazelcastContextDistributor.class.getCanonicalName());
+ .setPluginClass(HazelcastContextDistributor.class.getName());
final CuratorLockManagerParameters curatorParameters = new CuratorLockManagerParameters();
- curatorParameters.setPluginClass(CuratorLockManager.class.getCanonicalName());
+ curatorParameters.setPluginClass(CuratorLockManager.class.getName());
curatorParameters.setZookeeperAddress(ZOOKEEPER_ADDRESS + ":" + zookeeperPort);
contextParameters.setLockManagerParameters(curatorParameters);
setContextParmetersInParameterService(contextParameters);
fail(EXCEPTION_MESSAGE);
} catch (final ContextRuntimeException e) {
assertEquals(getMessage(TEST_POLICY_CONTEXT_ITEM000, "TestContextItem006",
- TestContextStringItem.class.getCanonicalName(), "stringValue=" + STRING_VAL),
+ TestContextStringItem.class.getName(), "stringValue=" + STRING_VAL),
e.getMessage());
LOGGER.trace(NORMAL_TEST_EXCEPTION, e);
}
fail(EXCEPTION_MESSAGE);
} catch (final ContextRuntimeException e) {
assertEquals(getMessage(TEST_POLICY_CONTEXT_ITEM001, "TestContextItem003",
- TestContextLongItem.class.getCanonicalName(), "longValue=" + INT_VAL_3), e.getMessage());
+ TestContextLongItem.class.getName(), "longValue=" + INT_VAL_3), e.getMessage());
LOGGER.trace(NORMAL_TEST_EXCEPTION, e);
}
}
}
private String getMessage(final String key, final String objName, final String clazzName, final String valString) {
- return getMessage(key, objName, clazzName, valString, TestPolicyContextItem.class.getCanonicalName());
+ return getMessage(key, objName, clazzName, valString, TestPolicyContextItem.class.getName());
}
private String getMessage(final String key, final String objName, final String clazzName, final String valString,
* The Class HazelcastContextDistributorTest.
*/
public class HazelcastContextDistributorTest {
- private static final String HAZEL_CAST_PLUGIN_CLASS = HazelcastContextDistributor.class.getCanonicalName();
+ private static final String HAZEL_CAST_PLUGIN_CLASS = HazelcastContextDistributor.class.getName();
// Logger for this class
private static final XLogger logger = XLoggerFactory.getXLogger(HazelcastContextDistributorTest.class);
public class InfinispanContextDistributorTest {
private static final XLogger logger = XLoggerFactory.getXLogger(InfinispanContextDistributorTest.class);
- private static final String PLUGIN_CLASS = InfinispanContextDistributor.class.getCanonicalName();
+ private static final String PLUGIN_CLASS = InfinispanContextDistributor.class.getName();
private SchemaParameters schemaParameters;
private ContextParameters contextParameters;
try {
dateAlbum.put("tci9", tci9);
} catch (final Exception e) {
- final String message = "class \"" + TestContextDateTzItem.class.getCanonicalName()
- + "\" not compatible with class \"" + TestContextDateLocaleItem.class.getCanonicalName()
+ final String message = "class \"" + TestContextDateTzItem.class.getName()
+ + "\" not compatible with class \"" + TestContextDateLocaleItem.class.getName()
+ "\"";
assertTrue(e.getMessage().contains(message));
LOGGER.trace(NORMAL_TEST_EXCEPTION, e);
fail(EXCEPTION_MESSAGE);
} catch (final Exception e) {
assertTrue(e.getMessage().endsWith("not compatible with class \""
- + TestContextDateLocaleItem.class.getCanonicalName() + "\""));
+ + TestContextDateLocaleItem.class.getName() + "\""));
LOGGER.trace(NORMAL_TEST_EXCEPTION, e);
}
assertEquals(5, dateAlbum1.size());
private static final String SCHEMAS2 = "Schemas";
private static final String KEY_INFO_MAP_KEY = "KeyInfoMapKey";
private static final String APPLICATION = "APPLICATION";
- private static final String JAVA_LONG = Long.class.getCanonicalName();
+ private static final String JAVA_LONG = Long.class.getName();
private static final String JAVA_FLAVOUR = "Java";
/**
*/
public static AxContextModel createPolicyContextModel() {
final AxContextSchema policySchema = new AxContextSchema(new AxArtifactKey("PolicySchema", VERSION),
- JAVA_FLAVOUR, TestPolicyContextItem.class.getCanonicalName());
+ JAVA_FLAVOUR, TestPolicyContextItem.class.getName());
final AxContextAlbum albumDefinition = new AxContextAlbum(new AxArtifactKey(POLICY_CONTEXT_ALBUM, VERSION),
APPLICATION, true, policySchema.getKey());
*/
public static AxContextModel createGlobalContextModel() {
final AxContextSchema globalSchema = new AxContextSchema(new AxArtifactKey("GlobalSchema", VERSION),
- JAVA_FLAVOUR, TestGlobalContextItem.class.getCanonicalName());
+ JAVA_FLAVOUR, TestGlobalContextItem.class.getName());
final AxContextAlbum albumDefinition = new AxContextAlbum(new AxArtifactKey(GLOBAL_CONTEXT_ALBUM, VERSION),
"GLOBAL", true, globalSchema.getKey());
*/
public static AxContextModel createExternalContextModel() {
final AxContextSchema externalSchema = new AxContextSchema(new AxArtifactKey("ExternalSchema", VERSION),
- JAVA_FLAVOUR, TestExternalContextItem.class.getCanonicalName());
+ JAVA_FLAVOUR, TestExternalContextItem.class.getName());
final AxContextAlbum albumDefinition = new AxContextAlbum(new AxArtifactKey(EXTERNAL_CONTEXT_ALBUM, VERSION),
"EXTERNAL", true, externalSchema.getKey());
final AxContextSchema longSchema =
new AxContextSchema(new AxArtifactKey("LongSchema", VERSION), JAVA_FLAVOUR, JAVA_LONG);
final AxContextSchema lTypeSchema = new AxContextSchema(new AxArtifactKey("LTypeSchema", VERSION), JAVA_FLAVOUR,
- TestContextLongItem.class.getCanonicalName());
+ TestContextLongItem.class.getName());
final AxContextSchema dateSchema = new AxContextSchema(new AxArtifactKey("DateSchema", VERSION), JAVA_FLAVOUR,
- TestContextDateLocaleItem.class.getCanonicalName());
+ TestContextDateLocaleItem.class.getName());
final AxContextSchema mapSchema = new AxContextSchema(new AxArtifactKey("MapSchema", VERSION), JAVA_FLAVOUR,
- TestContextTreeMapItem.class.getCanonicalName());
+ TestContextTreeMapItem.class.getName());
final AxContextSchemas schemas = new AxContextSchemas(new AxArtifactKey(SCHEMAS2, VERSION));
schemas.getSchemasMap().put(longSchema.getKey(), longSchema);
commandList.add("-Xmx512m");
commandList.add("-cp");
commandList.add(System.getProperty("java.class.path"));
- commandList.add(ConcurrentContextJvm.class.getCanonicalName());
+ commandList.add(ConcurrentContextJvm.class.getName());
commandList.add(configrationProvider.getTestName());
commandList.add(Integer.toString(jvm));
commandList.add(Integer.toString(configrationProvider.getThreadCount()));
commandList.add(System.getProperty("hazelcast.config", ""));
for (final Entry<String, ParameterGroup> parameterServiceEntry : ParameterService.getAll()) {
- commandList.add(parameterServiceEntry.getValue().getClass().getCanonicalName());
+ commandList.add(parameterServiceEntry.getValue().getClass().getName());
commandList.add(new Gson().toJson(parameterServiceEntry.getValue()));
}
@Test
public void testModelWriteReadJpa() throws Exception {
final DaoParameters DaoParameters = new DaoParameters();
- DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
+ DaoParameters.setPluginClass(DefaultApexDao.class.getName());
DaoParameters.setPersistenceUnit("SampleModelTest");
Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb");
@Test
public void testModelWriteReadJpa() throws Exception {
final DaoParameters DaoParameters = new DaoParameters();
- DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
+ DaoParameters.setPluginClass(DefaultApexDao.class.getName());
DaoParameters.setPersistenceUnit("SampleModelTest");
Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb");
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.apache.commons.cli.ParseException;
handler.parse(args);
fail("test should throw an exception");
} catch (ParseException pe) {
- assertEquals("Could not read parameters from configuration file "
- + "\"src/test/resources/parameters/unit/NonExistant.json\": "
- + "src/test/resources/parameters/unit/NonExistant.json", pe.getMessage());
+ assertTrue(pe.getMessage().startsWith("Could not read parameters from configuration file "));
}
try {
final String outputString = runModel2Cli(cliArgs);
assertTrue(outputString
- .contains("gen-model2cli: no '-m' model file given, cannot proceed (try -h for help)\n"));
+ .contains("gen-model2cli: no '-m' model file given, cannot proceed (try -h for help)"));
}
@Test