2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
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.apps.uservice.test.adapt.jms;
23 import java.io.Serializable;
25 import org.onap.policy.apex.service.engine.event.ApexEventException;
28 * @author Liam Fallon (liam.fallon@ericsson.com)
30 public class TestPing implements Serializable {
31 private static final long serialVersionUID = -3400711508992955886L;
33 private String name = "Rose";
34 private String description = "A rose by any other name would smell as sweet";
35 private long pingTime = System.currentTimeMillis();
36 private long pongTime = -1;
38 public String getName() {
42 public void setName(final String name) {
46 public String getDescription() {
50 public void setDescription(final String description) {
51 this.description = description;
54 public long getPingTime() {
58 public void setPingTime(final long pingTime) {
59 this.pingTime = pingTime;
62 public long getPongTime() {
66 public void setPongTime(final long pongTime) {
67 this.pongTime = pongTime;
71 public String toString() {
72 return "TestPing [name=" + name + ", description=" + description + ", pingTime=" + pingTime + ", pongTime="
76 public void verify() throws ApexEventException {
77 if (!name.startsWith("Rose")) {
78 throw new ApexEventException("TestPing is not valid");
81 if (name.length() <= 4) {
82 throw new ApexEventException("TestPing is not valid");
85 if (!description.startsWith("A rose by any other name would smell as sweet")) {
86 throw new ApexEventException("TestPing is not valid");
89 if (description.length() <= 44) {
90 throw new ApexEventException("TestPing is not valid");
93 if (pongTime <= pingTime) {
94 throw new ApexEventException("TestPing is not valid");