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;
25 import org.apache.commons.lang3.StringUtils;
26 import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
27 import org.onap.policy.common.parameters.GroupValidationResult;
28 import org.onap.policy.common.parameters.ValidationStatus;
31 * Dummy carrier technology parameters.
33 * <p>The parameters for this plugin are:
35 * <li>testToRun: The name of the test to run.
39 @EqualsAndHashCode(callSuper = false)
40 public class DummyCarrierTechnologyParameters extends CarrierTechnologyParameters {
42 /** The label of this carrier technology. */
43 public static final String DUMMY_CARRIER_TECHNOLOGY_LABEL = "DUMMY";
45 /** The producer plugin class for the dummy carrier technology. */
46 public static final String DUMMY_EVENT_PRODUCER_PLUGIN_CLASS = DummyApexEventProducer.class.getName();
48 /** The consumer plugin class for the dummy carrier technology. */
49 public static final String DUMMY_EVENT_CONSUMER_PLUGIN_CLASS = DummyApexEventConsumer.class.getName();
51 private String testToRun = null;
52 private String propertyFileName = null;
55 * Constructor to create a dummy carrier technology parameters instance and register the instance with the parameter
58 public DummyCarrierTechnologyParameters() {
61 // Set the carrier technology properties for the web socket carrier technology
62 this.setLabel(DUMMY_CARRIER_TECHNOLOGY_LABEL);
63 this.setEventProducerPluginClass(DUMMY_EVENT_PRODUCER_PLUGIN_CLASS);
64 this.setEventConsumerPluginClass(DUMMY_EVENT_CONSUMER_PLUGIN_CLASS);
72 public GroupValidationResult validate() {
73 final GroupValidationResult result = super.validate();
75 if (StringUtils.isEmpty(testToRun)) {
76 result.setResult("testToRun", ValidationStatus.INVALID,
77 "no test has been specified on the dummy carrier technology plugin");
80 if (StringUtils.isEmpty(propertyFileName)) {
81 result.setResult("propertyFileName", ValidationStatus.INVALID,
82 "no propertyFileName has been specified on the dummy carrier technology plugin");