2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.apex.testsuites.integration.uservice.executionproperties;
24 import lombok.EqualsAndHashCode;
26 import org.apache.commons.lang3.StringUtils;
27 import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
28 import org.onap.policy.common.parameters.GroupValidationResult;
29 import org.onap.policy.common.parameters.ValidationStatus;
32 * Dummy carrier technology parameters.
34 * <p>The parameters for this plugin are:
36 * <li>testToRun: The name of the test to run.
40 @EqualsAndHashCode(callSuper = false)
41 public class DummyCarrierTechnologyParameters extends CarrierTechnologyParameters {
43 /** The label of this carrier technology. */
44 public static final String DUMMY_CARRIER_TECHNOLOGY_LABEL = "DUMMY";
46 /** The producer plugin class for the dummy carrier technology. */
47 public static final String DUMMY_EVENT_PRODUCER_PLUGIN_CLASS = DummyApexEventProducer.class.getName();
49 /** The consumer plugin class for the dummy carrier technology. */
50 public static final String DUMMY_EVENT_CONSUMER_PLUGIN_CLASS = DummyApexEventConsumer.class.getName();
52 private String testToRun = null;
53 private String propertyFileName = null;
56 * Constructor to create a dummy carrier technology parameters instance and register the instance with the parameter
59 public DummyCarrierTechnologyParameters() {
62 // Set the carrier technology properties for the web socket carrier technology
63 this.setLabel(DUMMY_CARRIER_TECHNOLOGY_LABEL);
64 this.setEventProducerPluginClass(DUMMY_EVENT_PRODUCER_PLUGIN_CLASS);
65 this.setEventConsumerPluginClass(DUMMY_EVENT_CONSUMER_PLUGIN_CLASS);
73 public GroupValidationResult validate() {
74 final GroupValidationResult result = super.validate();
76 if (StringUtils.isEmpty(testToRun)) {
77 result.setResult("testToRun", ValidationStatus.INVALID,
78 "no test has been specified on the dummy carrier technology plugin");
81 if (StringUtils.isEmpty(propertyFileName)) {
82 result.setResult("propertyFileName", ValidationStatus.INVALID,
83 "no propertyFileName has been specified on the dummy carrier technology plugin");