summaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/test/java
diff options
context:
space:
mode:
authorhekeguang <hekeguang@chinamobile.com>2022-09-01 11:29:41 +0800
committerhekeguang <hekeguang@chinamobile.com>2022-09-01 11:30:34 +0800
commit6c778488d9ba9cd5084bf9407709a78004e4a885 (patch)
treeca007be051ea3c79cae72c8cf1a080604fa5aad7 /intentanalysis/src/test/java
parent0699e877538e8ee6179750112a4414848058fe09 (diff)
Add test code.
Issue-ID: USECASEUI-716 Change-Id: I234b4f0cdf1f2efc043cde497a107d9a00d7afdb Signed-off-by: hekeguang <hekeguang@chinamobile.com>
Diffstat (limited to 'intentanalysis/src/test/java')
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ConditionTest.java53
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ContextTest.java47
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java49
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTargetTest.java57
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTest.java57
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/FulfilmentInfoTest.java50
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentGoalBeanTest.java45
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java59
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentTest.java52
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/StateTest.java49
10 files changed, 518 insertions, 0 deletions
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ConditionTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ConditionTest.java
new file mode 100644
index 0000000..49f2cb5
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ConditionTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.OperatorType;
+
+import java.util.ArrayList;
+
+public class ConditionTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testSetConditionTest() throws Exception {
+ Condition condition = new Condition();
+ condition.setConditionId("");
+ condition.setConditionName("");
+ condition.setOperator(OperatorType.valueOf("OR"));
+ condition.setConditionValue("");
+ condition.setConditionList(new ArrayList<Condition>());
+ }
+
+ @Test
+ public void testGetConditionTest() throws Exception{
+ Condition condition = new Condition();
+ condition.getConditionId();
+ condition.getConditionName();
+ condition.getOperator();
+ condition.getConditionValue();
+ condition.getConditionList();
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ContextTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ContextTest.java
new file mode 100644
index 0000000..5ead1c8
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ContextTest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+
+public class ContextTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+ @Test
+ public void testGetContestTest(){
+ Context context = new Context();
+ context.getContextId();
+ context.getContextName();
+ context.getContextConditions();
+ }
+ @Test
+ public void testSetContestTest(){
+ Context context = new Context();
+ context.setContextId("");
+ context.setContextName("");
+ context.setContextConditions(new ArrayList<Condition>());
+ }
+
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java
new file mode 100644
index 0000000..52d8fbc
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.ObjectType;
+
+import java.util.ArrayList;
+
+public class ExpectationObjectTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetExpectationObjectTest() {
+ ExpectationObject test = new ExpectationObject();
+ test.getObjectType();
+ test.getObjectInstance();
+ test.getObjectContexts();
+ }
+
+ @Test
+ public void testSetExpectationObjectTest() {
+ ExpectationObject test = new ExpectationObject();
+ test.setObjectType(ObjectType.OBJECT1);
+ test.setObjectInstance("");
+ test.setObjectContexts(new ArrayList<>());
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTargetTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTargetTest.java
new file mode 100644
index 0000000..e879b11
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTargetTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.ExpectationType;
+
+import java.util.ArrayList;
+
+public class ExpectationTargetTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetExpectationTest() {
+ Expectation test = new Expectation();
+ test.getExpectationId();
+ test.getExpectationName();
+ test.getExpectationType();
+ test.getExpectationObject();
+ test.getExpectationTargets();
+ test.getExpectationContexts();
+ test.getExpectationFulfilmentInfo();
+ }
+
+ @Test
+ public void testSetExpectationTest() {
+ Expectation test = new Expectation();
+ test.setExpectationId("");
+ test.setExpectationName("");
+ test.setExpectationType(ExpectationType.ASSURANCE);
+ test.setExpectationObject(new ExpectationObject());
+ test.setExpectationTargets(new ArrayList<>());
+ test.setExpectationContexts(new ArrayList<>());
+ test.setExpectationFulfilmentInfo(new FulfilmentInfo());
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTest.java
new file mode 100644
index 0000000..a3c2a09
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.ExpectationType;
+
+import java.util.ArrayList;
+
+public class ExpectationTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetExpectationTest() {
+ Expectation test = new Expectation();
+ test.getExpectationId();
+ test.getExpectationContexts();
+ test.getExpectationName();
+ test.getExpectationType();
+ test.getExpectationFulfilmentInfo();
+ test.getExpectationObject();
+ test.getExpectationTargets();
+ }
+
+ @Test
+ public void testSetExpectationTest() {
+ Expectation test = new Expectation();
+ test.setExpectationId("");
+ test.setExpectationContexts(new ArrayList<Context>());
+ test.setExpectationName("");
+ test.setExpectationTargets(new ArrayList<ExpectationTarget>());
+ test.setExpectationType(ExpectationType.ASSURANCE);
+ test.setExpectationFulfilmentInfo(new FulfilmentInfo());
+ test.setExpectationObject(new ExpectationObject());
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/FulfilmentInfoTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/FulfilmentInfoTest.java
new file mode 100644
index 0000000..24529fd
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/FulfilmentInfoTest.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.FulfilmentStatus;
+import org.onap.usecaseui.intentanalysis.bean.enums.NotFulfilledState;
+
+public class FulfilmentInfoTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetFulfilmentInfoTest() {
+ FulfilmentInfo test = new FulfilmentInfo();
+ test.getFulfilmentStatus();
+ test.getNotFulfilledState();
+ test.getNotFulfilledReason();
+
+ }
+
+ @Test
+ public void testSetFulfilmentInfoTest() {
+ FulfilmentInfo test = new FulfilmentInfo();
+ test.setFulfilmentStatus(FulfilmentStatus.FULFILLED);
+ test.setNotFulfilledState(NotFulfilledState.ACKNOWLEDGED);
+ test.setNotFulfilledReason("");
+
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentGoalBeanTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentGoalBeanTest.java
new file mode 100644
index 0000000..8a5ac8a
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentGoalBeanTest.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.IntentGoalType;
+
+public class IntentGoalBeanTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetIntentGoalBeanTest() {
+ IntentGoalBean test = new IntentGoalBean();
+ test.getIntent();
+ test.getIntentGoalType();
+ }
+
+ @Test
+ public void testSetIntentGoalBeanTest() {
+ IntentGoalBean test = new IntentGoalBean();
+ test.setIntent(new Intent());
+ test.setIntentGoalType(IntentGoalType.DELETE);
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java
new file mode 100644
index 0000000..2368077
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.usecaseui.intentanalysis.bean.enums.IntentFunctionType;
+import org.onap.usecaseui.intentanalysis.bean.enums.SupportArea;
+
+import java.util.ArrayList;
+
+public class IntentManagementFunctionRegInfoTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetIntentManagementFunctionRegInfoTest() {
+ IntentManagementFunctionRegInfo test = new IntentManagementFunctionRegInfo();
+ test.getId();
+ test.getDescription();
+ test.getSupportArea();
+ test.getSupportModel();
+ test.getSupportInterfaces();
+ test.getHandleName();
+ test.getIntentFunctionType();
+
+ }
+
+ @Test
+ public void testSetIntentManagementFunctionRegInfoTest() {
+ IntentManagementFunctionRegInfo test = new IntentManagementFunctionRegInfo();
+ test.setId("");
+ test.setDescription("");
+ test.setSupportArea(new ArrayList<SupportArea>());
+ test.setSupportModel("");
+ test.setSupportInterfaces(new ArrayList<>());
+ test.setHandleName("");
+ test.setIntentFunctionType(IntentFunctionType.INTERNALFUNCTION);
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentTest.java
new file mode 100644
index 0000000..33609e9
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+
+public class IntentTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetIntentTest() {
+ Intent test = new Intent();
+ test.getIntentId();
+ test.getIntentName();
+ test.getIntentExpectations();
+ test.getIntentContexts();
+ test.getIntentFulfilmentInfo();
+ }
+
+ @Test
+ public void testSetIntentTest() {
+ Intent test = new Intent();
+ test.setIntentId("");
+ test.setIntentName("");
+ test.setIntentExpectations(new ArrayList<Expectation>());
+ test.setIntentContexts(new ArrayList<Context>());
+ test.setIntentFulfilmentInfo(new FulfilmentInfo());
+ }
+}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/StateTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/StateTest.java
new file mode 100644
index 0000000..e04ea3a
--- /dev/null
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/StateTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 CMCC, Inc. and others. All rights reserved.
+ *
+ * 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.
+ */
+package org.onap.usecaseui.intentanalysis.bean.models;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class StateTest {
+ @Before
+ public void before() throws Exception {
+ }
+
+ @After
+ public void after() throws Exception {
+ }
+
+ @Test
+ public void testGetStateTest() {
+ State test = new State();
+ test.getStateId();
+ test.getStateName();
+ test.getCondition();
+ test.getIsSatisfied();
+
+ }
+
+ @Test
+ public void testSetStateTest() {
+ State test = new State();
+ test.setStateId("");
+ test.setStateName("");
+ test.setCondition("");
+ test.setIsSatisfied(true);
+ }
+}