summaryrefslogtreecommitdiffstats
path: root/ResmanagementService/service/src/integration-test
diff options
context:
space:
mode:
Diffstat (limited to 'ResmanagementService/service/src/integration-test')
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/mocoserver/VimDriverSuccessServer.java72
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaFail.java58
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaSuccess.java51
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLimitsRoa.java62
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaFail.java61
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaSuccess.java54
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaFail.java61
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaSuccess.java54
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaFail.java58
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaSuccess.java51
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaFail.java50
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaSuccess.java66
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaFail.java58
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaSuccess.java51
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/AddSuccessChecker.java46
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/FailureChecker.java44
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/GetSuccessChecker.java48
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyChecker.java59
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyTestManager.java163
-rw-r--r--ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/SuccessChecker.java46
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/getcpulimits.json26
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/getdisklimits.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/gethost.json51
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/gethosts.json26
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/getnetworks.json54
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/getports.json60
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor1.json31
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor2.json31
-rw-r--r--ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor3.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/server.properties14
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostsfail1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostssuccess1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostsfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostssuccess1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostsfail1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostssuccess1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidsuccess1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querycpulimitssuccess1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querydisklimitssuccess1.json21
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationsfail1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationssuccess1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationsfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationssuccess1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationsfail1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationssuccess1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidsuccess1.json22
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworksfail1.json26
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworkssuccess1.json26
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworksfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworkssuccess1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworksfail1.json26
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworkssuccess1.json26
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidsuccess1.json25
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportsfail1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportssuccess1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportsfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportssuccess1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportsfail1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportssuccess1.json24
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidsuccess1.json23
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcefail1.json18
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcesuccess1.json18
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcefail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcesuccess1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcefail1.json17
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcesuccess1.json17
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitesfail1.json30
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitessuccess1.json30
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitesfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitessuccess1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitesfail1.json30
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitessuccess1.json30
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidfail1.json15
-rw-r--r--ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidsuccess1.json29
-rw-r--r--ResmanagementService/service/src/integration-test/resources/urlconfig.json18
79 files changed, 2570 insertions, 0 deletions
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/mocoserver/VimDriverSuccessServer.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/mocoserver/VimDriverSuccessServer.java
new file mode 100644
index 0000000..1d6123f
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/mocoserver/VimDriverSuccessServer.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.mocoserver;
+
+import org.openo.sdno.testframework.moco.MocoHttpServer;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 28, 2016
+ */
+public class VimDriverSuccessServer extends MocoHttpServer {
+
+ private static final String GET_CPU_LIMITS = "src/integration-test/resources/mocoserver/getcpulimits.json";
+
+ private static final String GET_DISK_LIMITS = "src/integration-test/resources/mocoserver/getdisklimits.json";
+
+ private static final String GET_HOSTS_FILE = "src/integration-test/resources/mocoserver/gethosts.json";
+
+ private static final String GET_HOST_FILE = "src/integration-test/resources/mocoserver/gethost.json";
+
+ private static final String GET_NETWORKS_FILE = "src/integration-test/resources/mocoserver/getnetworks.json";
+
+ private static final String GET_PORTS_FILE = "src/integration-test/resources/mocoserver/getports.json";
+
+ private static final String SEND_ADD_MONITOR_FILE =
+ "src/integration-test/resources/mocoserver/sendmsgmonitor1.json";
+
+ private static final String SEND_MOD_MONITOR_FILE =
+ "src/integration-test/resources/mocoserver/sendmsgmonitor2.json";
+
+ private static final String SEND_DEL_MONITOR_FILE =
+ "src/integration-test/resources/mocoserver/sendmsgmonitor3.json";
+
+ public VimDriverSuccessServer() {
+ super();
+ }
+
+ public VimDriverSuccessServer(int port) {
+ super(port);
+ }
+
+ @Override
+ public void addRequestResponsePairs() {
+ this.addRequestResponsePair(GET_CPU_LIMITS);
+ this.addRequestResponsePair(GET_DISK_LIMITS);
+ this.addRequestResponsePair(GET_HOSTS_FILE);
+ this.addRequestResponsePair(GET_HOST_FILE);
+ this.addRequestResponsePair(GET_NETWORKS_FILE);
+ this.addRequestResponsePair(GET_PORTS_FILE);
+ this.addRequestResponsePair(SEND_ADD_MONITOR_FILE);
+ this.addRequestResponsePair(SEND_MOD_MONITOR_FILE);
+ this.addRequestResponsePair(SEND_DEL_MONITOR_FILE);
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaFail.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaFail.java
new file mode 100644
index 0000000..27e4c59
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaFail.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 24, 2016
+ */
+public class ITHostRoaFail extends MyTestManager {
+
+ private static final String GET_PATH = "src/integration-test/resources/testcase/hostroa/queryhostsbyidfail1.json";
+
+ private static final String POST_PATH = "src/integration-test/resources/testcase/hostroa/createhostsfail1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/hostroa/modhostsfail1.json";
+
+ private static final String DEL_PATH = "src/integration-test/resources/testcase/hostroa/deletehostsfail1.json";
+
+ private static final String POST_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/hostroa/createhostssuccess1.json";
+
+ private static final String DEL_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/hostroa/deletehostssuccess1.json";
+
+ @Test
+ public void testOperateFail() throws ServiceException {
+ execTestCase(new File(POST_SUCCESS_PATH));
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ execTestCase(new File(DEL_SUCCESS_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaSuccess.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaSuccess.java
new file mode 100644
index 0000000..72ac04d
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITHostRoaSuccess.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 20, 2016
+ */
+public class ITHostRoaSuccess extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/hostroa/queryhostsbyidsuccess1.json";
+
+ private static final String POST_PATH = "src/integration-test/resources/testcase/hostroa/createhostssuccess1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/hostroa/modhostssuccess1.json";
+
+ private static final String DEL_PATH = "src/integration-test/resources/testcase/hostroa/deletehostssuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLimitsRoa.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLimitsRoa.java
new file mode 100644
index 0000000..f9ef461
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLimitsRoa.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.mocoserver.VimDriverSuccessServer;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 28, 2016
+ */
+public class ITLimitsRoa extends MyTestManager {
+
+ private VimDriverSuccessServer driver = new VimDriverSuccessServer();
+
+ private static final String GET_CPU_PATH =
+ "src/integration-test/resources/testcase/limitsroa/querycpulimitssuccess1.json";
+
+ private static final String GET_DISK_PATH =
+ "src/integration-test/resources/testcase/limitsroa/querydisklimitssuccess1.json";
+
+ @Before
+ public void setup() throws ServiceException, InterruptedException {
+ driver.start();
+ // Thread.sleep(60 * 1000);
+ }
+
+ @After
+ public void tearDown() throws ServiceException {
+ driver.stop();
+ }
+
+ @Test
+ public void testGetLimitsSuccess() throws ServiceException {
+ execTestCase(new File(GET_CPU_PATH));
+ execTestCase(new File(GET_DISK_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaFail.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaFail.java
new file mode 100644
index 0000000..3d8b67d
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaFail.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 27, 2016
+ */
+public class ITLocationRoaFail extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/locationroa/querylocationsbyidfail1.json";
+
+ private static final String POST_PATH =
+ "src/integration-test/resources/testcase/locationroa/createlocationsfail1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/locationroa/modlocationsfail1.json";
+
+ private static final String DEL_PATH =
+ "src/integration-test/resources/testcase/locationroa/deletelocationsfail1.json";
+
+ private static final String POST_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/locationroa/createlocationssuccess1.json";
+
+ private static final String DEL_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/locationroa/deletelocationssuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_SUCCESS_PATH));
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ execTestCase(new File(DEL_SUCCESS_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaSuccess.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaSuccess.java
new file mode 100644
index 0000000..c3641b2
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITLocationRoaSuccess.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 26, 2016
+ */
+public class ITLocationRoaSuccess extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/locationroa/querylocationsbyidsuccess1.json";
+
+ private static final String POST_PATH =
+ "src/integration-test/resources/testcase/locationroa/createlocationssuccess1.json";
+
+ private static final String PUT_PATH =
+ "src/integration-test/resources/testcase/locationroa/modlocationssuccess1.json";
+
+ private static final String DEL_PATH =
+ "src/integration-test/resources/testcase/locationroa/deletelocationssuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaFail.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaFail.java
new file mode 100644
index 0000000..7b9cb54
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaFail.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 27, 2016
+ */
+public class ITNetworkRoaFail extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/networkroa/querynetworksbyidfail1.json";
+
+ private static final String POST_PATH =
+ "src/integration-test/resources/testcase/networkroa/createnetworksfail1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/networkroa/modnetworksfail1.json";
+
+ private static final String DEL_PATH =
+ "src/integration-test/resources/testcase/networkroa/deletenetworksfail1.json";
+
+ private static final String POST_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/networkroa/createnetworkssuccess1.json";
+
+ private static final String DEL_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/networkroa/deletenetworkssuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_SUCCESS_PATH));
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ execTestCase(new File(DEL_SUCCESS_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaSuccess.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaSuccess.java
new file mode 100644
index 0000000..50f0aeb
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITNetworkRoaSuccess.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 27, 2016
+ */
+public class ITNetworkRoaSuccess extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/networkroa/querynetworksbyidsuccess1.json";
+
+ private static final String POST_PATH =
+ "src/integration-test/resources/testcase/networkroa/createnetworkssuccess1.json";
+
+ private static final String PUT_PATH =
+ "src/integration-test/resources/testcase/networkroa/modnetworkssuccess1.json";
+
+ private static final String DEL_PATH =
+ "src/integration-test/resources/testcase/networkroa/deletenetworkssuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaFail.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaFail.java
new file mode 100644
index 0000000..d4b9d34
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaFail.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 26, 2016
+ */
+public class ITPortRoaFail extends MyTestManager {
+
+ private static final String GET_PATH = "src/integration-test/resources/testcase/portroa/queryportsbyidfail1.json";
+
+ private static final String POST_PATH = "src/integration-test/resources/testcase/portroa/createportsfail1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/portroa/modportsfail1.json";
+
+ private static final String DEL_PATH = "src/integration-test/resources/testcase/portroa/deleteportsfail1.json";
+
+ private static final String POST_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/portroa/createportssuccess1.json";
+
+ private static final String DEL_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/portroa/deleteportssuccess1.json";
+
+ @Test
+ public void testOperateFail() throws ServiceException {
+ execTestCase(new File(POST_SUCCESS_PATH));
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ execTestCase(new File(DEL_SUCCESS_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaSuccess.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaSuccess.java
new file mode 100644
index 0000000..fadf854
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITPortRoaSuccess.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 26, 2016
+ */
+public class ITPortRoaSuccess extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/portroa/queryportsbyidsuccess1.json";
+
+ private static final String POST_PATH = "src/integration-test/resources/testcase/portroa/createportssuccess1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/portroa/modportssuccess1.json";
+
+ private static final String DEL_PATH = "src/integration-test/resources/testcase/portroa/deleteportssuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaFail.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaFail.java
new file mode 100644
index 0000000..dcb3dd9
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaFail.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Oct 15, 2016
+ */
+public class ITResOperateRoaFail extends MyTestManager {
+
+ private static final String POST_PATH =
+ "src/integration-test/resources/testcase/resoperateroa/addresourcefail1.json";
+
+ private static final String PUT_PATH =
+ "src/integration-test/resources/testcase/resoperateroa/modresourcefail1.json";
+
+ private static final String DEL_PATH =
+ "src/integration-test/resources/testcase/resoperateroa/deleteresourcefail1.json";
+
+ @Test
+ public void testOperateFail() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaSuccess.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaSuccess.java
new file mode 100644
index 0000000..718d688
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITResOperateRoaSuccess.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.mocoserver.VimDriverSuccessServer;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Oct 15, 2016
+ */
+public class ITResOperateRoaSuccess extends MyTestManager {
+
+ private VimDriverSuccessServer driver = new VimDriverSuccessServer();
+
+ private static final String POST_PATH =
+ "src/integration-test/resources/testcase/resoperateroa/addresourcesuccess1.json";
+
+ private static final String PUT_PATH =
+ "src/integration-test/resources/testcase/resoperateroa/modresourcesuccess1.json";
+
+ private static final String DEL_PATH =
+ "src/integration-test/resources/testcase/resoperateroa/deleteresourcesuccess1.json";
+
+ @Before
+ public void setup() throws ServiceException, InterruptedException {
+ driver.start();
+ // Thread.sleep(30 * 1000);
+ }
+
+ @After
+ public void tearDown() throws ServiceException {
+ driver.stop();
+ }
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaFail.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaFail.java
new file mode 100644
index 0000000..a96c451
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaFail.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 27, 2016
+ */
+public class ITSitesRoaFail extends MyTestManager {
+
+ private static final String GET_PATH = "src/integration-test/resources/testcase/siteroa/querysitesbyidfail1.json";
+
+ private static final String POST_PATH = "src/integration-test/resources/testcase/siteroa/createsitesfail1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/siteroa/modsitesfail1.json";
+
+ private static final String DEL_PATH = "src/integration-test/resources/testcase/siteroa/deletesitesfail1.json";
+
+ private static final String POST_SUSCCESS_PATH =
+ "src/integration-test/resources/testcase/siteroa/createsitessuccess1.json";
+
+ private static final String DEL_SUCCESS_PATH =
+ "src/integration-test/resources/testcase/siteroa/deletesitessuccess1.json";
+
+ @Test
+ public void testOperateFail() throws ServiceException {
+ execTestCase(new File(POST_SUSCCESS_PATH));
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ execTestCase(new File(DEL_SUCCESS_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaSuccess.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaSuccess.java
new file mode 100644
index 0000000..b7736c3
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/test/ITSitesRoaSuccess.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.test;
+
+import java.io.File;
+
+import org.junit.Test;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.nfvo.resmanagement.util.MyTestManager;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 27, 2016
+ */
+public class ITSitesRoaSuccess extends MyTestManager {
+
+ private static final String GET_PATH =
+ "src/integration-test/resources/testcase/siteroa/querysitesbyidsuccess1.json";
+
+ private static final String POST_PATH = "src/integration-test/resources/testcase/siteroa/createsitessuccess1.json";
+
+ private static final String PUT_PATH = "src/integration-test/resources/testcase/siteroa/modsitessuccess1.json";
+
+ private static final String DEL_PATH = "src/integration-test/resources/testcase/siteroa/deletesitessuccess1.json";
+
+ @Test
+ public void testOperateSuccess() throws ServiceException {
+ execTestCase(new File(POST_PATH));
+ execTestCase(new File(GET_PATH));
+ execTestCase(new File(PUT_PATH));
+ execTestCase(new File(DEL_PATH));
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/AddSuccessChecker.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/AddSuccessChecker.java
new file mode 100644
index 0000000..48bc3a2
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/AddSuccessChecker.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.util;
+
+import org.openo.sdno.testframework.checker.IChecker;
+import org.openo.sdno.testframework.http.model.HttpResponse;
+
+import net.sf.json.JSONObject;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 21, 2016
+ */
+public class AddSuccessChecker implements IChecker {
+
+ String addMsg = "org.openo.nfvo.resmanage.common.update.success";
+
+ @Override
+ public boolean check(HttpResponse response) {
+ String data = response.getData();
+ System.out.println(data);
+ JSONObject dataObj = JSONObject.fromObject(data);
+ if(response.getStatus() == 200 && addMsg.equals(dataObj.getString("msg"))) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/FailureChecker.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/FailureChecker.java
new file mode 100644
index 0000000..dc9f7e8
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/FailureChecker.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.util;
+
+import org.openo.sdno.testframework.checker.IChecker;
+import org.openo.sdno.testframework.http.model.HttpResponse;
+
+import net.sf.json.JSONObject;
+
+/**
+ * <br/>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Aug 16, 2016
+ */
+public class FailureChecker implements IChecker {
+
+ @Override
+ public boolean check(HttpResponse response) {
+ String data = response.getData();
+ if(response.getStatus() != 200) {
+ return true;
+ }
+ JSONObject dataObj = JSONObject.fromObject(data);
+ int retCode = (int)dataObj.get("retCode");
+ return retCode == -1;
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/GetSuccessChecker.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/GetSuccessChecker.java
new file mode 100644
index 0000000..87e9a51
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/GetSuccessChecker.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.util;
+
+import org.openo.sdno.testframework.checker.IChecker;
+import org.openo.sdno.testframework.http.model.HttpResponse;
+
+import net.sf.json.JSONObject;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 21, 2016
+ */
+public class GetSuccessChecker implements IChecker {
+
+ String addMsg = "org.openo.nfvo.resmanage.common.add.success";
+
+ @Override
+ public boolean check(HttpResponse response) {
+ System.out.println(response);
+ String data = response.getData();
+ System.out.println(data);
+ JSONObject dataObj = JSONObject.fromObject(data);
+ if(response.getStatus() == 200 && !dataObj.isEmpty()) {
+ System.out.println(dataObj.isEmpty());
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyChecker.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyChecker.java
new file mode 100644
index 0000000..00fd5b6
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyChecker.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.util;
+
+import org.openo.sdno.testframework.checker.DefaultChecker;
+import org.openo.sdno.testframework.http.model.HttpResponse;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 21, 2016
+ */
+public class MyChecker extends DefaultChecker {
+
+ private HttpResponse expectedResponse;
+
+ /**
+ * Constructor<br>
+ * <p>
+ * </p>
+ *
+ * @param expectedResponse
+ * @since NFVO 0.5
+ */
+ public MyChecker(HttpResponse expectedResponse) {
+ super(expectedResponse);
+ this.expectedResponse = expectedResponse;
+ }
+
+ /**
+ * <br>
+ *
+ * @param response
+ * @return
+ * @since NFVO 0.5
+ */
+ @Override
+ public boolean check(HttpResponse response) {
+ return expectedResponse.equals(response);
+ }
+
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyTestManager.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyTestManager.java
new file mode 100644
index 0000000..97ebe50
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/MyTestManager.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2016 Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.util;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
+import org.openo.baseservice.roa.util.restclient.RestfulParametes;
+import org.openo.baseservice.roa.util.restclient.RestfulResponse;
+import org.openo.sdno.testframework.checker.DefaultChecker;
+import org.openo.sdno.testframework.http.model.HttpModelUtils;
+import org.openo.sdno.testframework.http.model.HttpRequest;
+import org.openo.sdno.testframework.http.model.HttpResponse;
+import org.openo.sdno.testframework.http.model.HttpRquestResponse;
+import org.openo.sdno.testframework.restclient.HttpRestClient;
+import org.openo.sdno.testframework.testmanager.TestManager;
+import org.openo.sdno.testframework.util.file.FileUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Sep 21, 2016
+ */
+public class MyTestManager extends TestManager {
+
+ private HttpRestClient restClient;
+
+ public MyTestManager() {
+ restClient = new HttpRestClient();
+ }
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(MyTestManager.class);
+
+ /**
+ * <br>
+ *
+ * @param file
+ * @return
+ * @throws ServiceException
+ * @since NFVO 0.5
+ */
+ @Override
+ public HttpResponse execTestCase(File file) throws ServiceException {
+ String content = FileUtils.readFromJson(file);
+ HttpRquestResponse httpObject = HttpModelUtils.praseHttpRquestResponse(content);
+ return send(httpObject.getRequest(), httpObject.getResponse());
+ }
+
+ private HttpResponse send(HttpRequest request, HttpResponse response) {
+ try {
+ RestfulResponse responseResult = doSend(request);
+ DefaultChecker checker = new MyChecker(response);
+ HttpResponse httpResponse = HttpModelUtils.convertResponse(responseResult);
+ Assert.assertEquals(Boolean.valueOf(checker.check(httpResponse)), Boolean.valueOf(true));
+ return httpResponse;
+ } catch(ServiceException e) {
+ LOGGER.error("call the restful interface failed.", e);
+ }
+ return null;
+ }
+
+ private RestfulResponse doSend(HttpRequest request) throws ServiceException {
+ String url = request.getUri();
+ String method = request.getMethod();
+ String body = request.getData();
+ RestfulParametes restfulParametes = new RestfulParametes();
+ Map requestHeaders = request.getHeaders();
+ if(null != requestHeaders) {
+ java.util.Map.Entry curEntity;
+ for(Iterator iterator = requestHeaders.entrySet().iterator(); iterator.hasNext(); restfulParametes
+ .putHttpContextHeader((String)curEntity.getKey(), (String)curEntity.getValue()))
+ curEntity = (java.util.Map.Entry)iterator.next();
+
+ }
+ Map paramMap = request.getQueries();
+ if(null != paramMap)
+ restfulParametes.setParamMap(paramMap);
+ if(null != body)
+ restfulParametes.setRawData(body);
+ return callRestfulMotheds(url, method, restfulParametes);
+ }
+
+ private RestfulResponse callRestfulMotheds(String url, String method, RestfulParametes restfulParametes)
+ throws ServiceException {
+ String s = method;
+ byte byte0 = -1;
+ switch(s.hashCode()) {
+ case 3446944:
+ if(s.equals("post"))
+ byte0 = 0;
+ break;
+
+ case 102230:
+ if(s.equals("get"))
+ byte0 = 1;
+ break;
+
+ case 111375:
+ if(s.equals("put"))
+ byte0 = 2;
+ break;
+
+ case -1335458389:
+ if(s.equals("delete"))
+ byte0 = 3;
+ break;
+
+ case 3198432:
+ if(s.equals("head"))
+ byte0 = 4;
+ break;
+
+ case 106438728:
+ if(s.equals("patch"))
+ byte0 = 5;
+ break;
+ }
+ switch(byte0) {
+ case 0: // '\0'
+ return restClient.post(url, restfulParametes);
+
+ case 1: // '\001'
+ return restClient.get(url, restfulParametes);
+
+ case 2: // '\002'
+ return restClient.put(url, restfulParametes);
+
+ case 3: // '\003'
+ return restClient.delete(url, restfulParametes);
+
+ case 4: // '\004'
+ return restClient.head(url, restfulParametes);
+
+ case 5: // '\005'
+ return restClient.patch(url, restfulParametes);
+ }
+ LOGGER.error("The method is unsupported.");
+ throw new ServiceException("The method is unsupported.");
+ }
+
+}
diff --git a/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/SuccessChecker.java b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/SuccessChecker.java
new file mode 100644
index 0000000..7817e76
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/java/org/openo/nfvo/resmanagement/util/SuccessChecker.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ *
+ * 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.openo.nfvo.resmanagement.util;
+
+import org.openo.sdno.testframework.checker.IChecker;
+import org.openo.sdno.testframework.http.model.HttpResponse;
+
+import net.sf.json.JSONObject;
+
+/**
+ * <br/>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version NFVO 0.5 Aug 16, 2016
+ */
+public class SuccessChecker implements IChecker {
+
+ String addMsg = "org.openo.nfvo.resmanage.common.add.success";
+
+ @Override
+ public boolean check(HttpResponse response) {
+ String data = response.getData();
+ System.out.println(data);
+ JSONObject dataObj = JSONObject.fromObject(data);
+ if(response.getStatus() == 200 && addMsg.equals(dataObj.getString("msg"))) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/getcpulimits.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/getcpulimits.json
new file mode 100644
index 0000000..c2eb426
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/getcpulimits.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "uri": "/openoapi/vimdriver/v1/limits/1234/cpumemory",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "query": {
+ "vimId": "123"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "limits": {
+ "rate": [],
+ "absolute": {
+ "maxTotalVolumes": 1000,
+ "totalVolumesUsed": 14,
+ "maxTotalVolumeGigabytes": 42000,
+ "totalGigabytesUsed":1054
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/getdisklimits.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/getdisklimits.json
new file mode 100644
index 0000000..a99b0df
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/getdisklimits.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/vimdriver/v1/limits/1234/disk",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "query": {
+ "vimId": "123"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "vimId": "123",
+ "vimName": "vim1",
+ "limits": {
+ "volumes": 1000,
+ "gigabytes": 42000,
+ "snapshots": 100
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/gethost.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/gethost.json
new file mode 100644
index 0000000..427d208
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/gethost.json
@@ -0,0 +1,51 @@
+{
+ "request": {
+ "uri": "/openoapi/vimdriver/v1/[a-zA-Z0-9\\-\\_]{1,36}/hosts/[a-zA-Z0-9\\-\\_]{1,36}",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "query": {
+ "vimId": "123",
+ "tenantId": "1234"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "hosts": [{
+ "resource": {
+ "cpu": 1,
+ "disk_gb": 1028,
+ "host": "c1a7de0ac9d94e4baceae031d05caae3",
+ "memory_mb": 8192,
+ "project": "(total)"
+ },
+ "vimId": "123",
+ "vimName": "vim"
+ },
+ {
+ "resource": {
+ "cpu": 0,
+ "disk_gb": 0,
+ "host": "c1a7de0ac9d94e4baceae031d05caae3",
+ "memory_mb": 512,
+ "project": "(used_now)"
+ },
+ "vimId": "123",
+ "vimName": "vim"
+ },
+ {
+ "resource": {
+ "cpu": 0,
+ "disk_gb": 0,
+ "host": "c1a7de0ac9d94e4baceae031d05caae3",
+ "memory_mb": 0,
+ "project": "(used_max)"
+ },
+ "vimId": "123",
+ "vimName": "vim"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/gethosts.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/gethosts.json
new file mode 100644
index 0000000..58d315b
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/gethosts.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "uri": "/openoapi/vimdriver/v1/[a-zA-Z0-9\\-\\_]{1,36}/hosts",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "query": {
+ "vimId": "123",
+ "tenantId": "1234"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "hosts": [
+ {
+ "host_name": "09c025b0efc64211bd23fc50fa974cdf",
+ "service": "compute",
+ "zone": "nova",
+ "vimId": "123",
+ "vimName": "vim"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/getnetworks.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/getnetworks.json
new file mode 100644
index 0000000..e8afa28
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/getnetworks.json
@@ -0,0 +1,54 @@
+{
+ "request": {
+ "uri": "/openoapi/vimdriver/v1/networks",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "query": {
+ "vimId": "123",
+ "tenantId": "1234"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "networks": [{
+ "status": "ACTIVE",
+ "subnets": ["54d6f61d-db07-451c-9ab3-b9609b6b6f0b"],
+ "name": "private-network",
+ "provider:physical_network": null,
+ "admin_state_up": true,
+ "project_id": "4fd44f30292945e481c7b8a0c8908869",
+ "tenant_id": "4fd44f30292945e481c7b8a0c8908869",
+ "qos_policy_id": "6a8454ade84346f59e8d40665f878b2e",
+ "provider:network_type": "local",
+ "router:external": true,
+ "mtu": 0,
+ "shared": true,
+ "id": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
+ "provider:segmentation_id": null,
+ "vimId": "123",
+ "vimName": "vim"
+ },
+ {
+ "status": "ACTIVE",
+ "subnets": ["08eae331-0402-425a-923c-34f7cfe39c1b"],
+ "name": "private",
+ "provider:physical_network": null,
+ "admin_state_up": true,
+ "project_id": "26a7980765d0414dbc1fc1f88cdb7e6e",
+ "tenant_id": "26a7980765d0414dbc1fc1f88cdb7e6e",
+ "qos_policy_id": "bfdb6c39f71e4d44b1dfbda245c50819",
+ "provider:network_type": "local",
+ "router:external": true,
+ "mtu": 0,
+ "shared": true,
+ "id": "db193ab3-96e3-4cb3-8fc5-05f4296d0324",
+ "provider:segmentation_id": null,
+ "vimId": "123",
+ "vimName": "vim"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/getports.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/getports.json
new file mode 100644
index 0000000..37902ca
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/getports.json
@@ -0,0 +1,60 @@
+{
+ "request": {
+ "uri": "/openoapi/vimdriver/v1/ports",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "query": {
+ "vimId": "123",
+ "tenantId": "1234"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "ports": [{
+ "status": "ACTIVE",
+ "name": "",
+ "allowed_address_pairs": [],
+ "admin_state_up": true,
+ "network_id": "70c1db1f-b701-45bd-96e0-a313ee3430b3",
+ "project_id": "",
+ "tenant_id": "",
+ "extra_dhcp_opts": [],
+ "device_owner": "network:router_gateway",
+ "mac_address": "fa:16:3e:58:42:ed",
+ "fixed_ips": [{
+ "subnet_id": "008ba151-0b8c-4a67-98b5-0d2b87666062",
+ "ip_address": "172.24.4.2"
+ }],
+ "id": "d80b1a3b-4fc1-49f3-952e-1e2ab7081d8b",
+ "security_groups": [],
+ "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824",
+ "vimId": "123",
+ "vimName": "vim"
+ },
+ {
+ "status": "ACTIVE",
+ "name": "",
+ "allowed_address_pairs": [],
+ "admin_state_up": true,
+ "network_id": "f27aa545-cbdd-4907-b0c6-c9e8b039dcc2",
+ "project_id": "d397de8a63f341818f198abb0966f6f3",
+ "tenant_id": "d397de8a63f341818f198abb0966f6f3",
+ "extra_dhcp_opts": [],
+ "device_owner": "network:router_interface",
+ "mac_address": "fa:16:3e:bb:3c:e4",
+ "fixed_ips": [{
+ "subnet_id": "288bf4a1-51ba-43b6-9d0a-520e9005db17",
+ "ip_address": "10.0.0.1"
+ }],
+ "id": "f71a6703-d6de-4be1-a91a-a570ede1d159",
+ "security_groups": [],
+ "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824",
+ "vimId": "123",
+ "vimName": "vim"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor1.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor1.json
new file mode 100644
index 0000000..9cbc812
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor1.json
@@ -0,0 +1,31 @@
+{
+ "request": {
+ "uri": "/openoapi/umcres/v1/resinfo",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "operationType": "create",
+ "resourceType": "HOST",
+ "label": "09c025b0efc64211bd23fc50fa974cdf",
+ "data": [{
+ "cpu": "1",
+ "disk": "1028",
+ "id": "12345678",
+ "memory": "8192",
+ "name": "09c025b0efc64211bd23fc50fa974cdf",
+ "vimId": "123",
+ "vimName": "vim"
+ }]
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "result": "SUCCESS",
+ "info": "resource monitor info add ok",
+ "oid": ["12345678"]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor2.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor2.json
new file mode 100644
index 0000000..631cf55
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor2.json
@@ -0,0 +1,31 @@
+{
+ "request": {
+ "uri": "/openoapi/umcres/v1/resinfo",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "operationType": "update",
+ "resourceType": "HOST",
+ "label": "09c025b0efc64211bd23fc50fa974cdf",
+ "data": [{
+ "cpu": "20",
+ "disk": "100",
+ "id": "12345678",
+ "memory": "8",
+ "name": "09c025b0efc64211bd23fc50fa974cdf",
+ "vimId": "123",
+ "vimName": "456"
+ }]
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "result":"SUCCESS",
+ "info":"resource monitor info update ok",
+ "oid":["12345678"]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor3.json b/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor3.json
new file mode 100644
index 0000000..4452178
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/mocoserver/sendmsgmonitor3.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/umcres/v1/resinfo",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "operationType": "delete",
+ "resourceType": "HOST",
+ "label": "09c025b0efc64211bd23fc50fa974cdf",
+ "deleteIds": ["12345678"]
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "result":"SUCCESS",
+ "info":"resource monitor info delete ok",
+ "oid":["12345678"]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/server.properties b/ResmanagementService/service/src/integration-test/resources/server.properties
new file mode 100644
index 0000000..44f3fdf
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/server.properties
@@ -0,0 +1,14 @@
+
+## Integration Test Server Configuration File
+
+## Server IpAddress
+serverip=127.0.0.1
+
+## Server Port
+serverport=8080
+
+## Http Moco Server Port
+mocohttpport=12306
+
+## Https Moco Server Port
+mocohttpsport=12307 \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostsfail1.json
new file mode 100644
index 0000000..2966f48
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostsfail1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id":"12345678",
+ "name": "hostName",
+ "cpu": "20",
+ "memory": "8",
+ "disk": "100",
+ "vimId": "123",
+ "vimName": "456"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.host.add.id.check"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostssuccess1.json
new file mode 100644
index 0000000..4573a0c
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/createhostssuccess1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id":"12345678",
+ "name": "hostName",
+ "cpu": "20",
+ "memory": "8",
+ "disk": "100",
+ "vimId": "123",
+ "vimName": "456"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.add.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostsfail1.json
new file mode 100644
index 0000000..5144c9a
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostsfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts?id=aaaa",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostssuccess1.json
new file mode 100644
index 0000000..98f3d13
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/deletehostssuccess1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts?id=12345678",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostsfail1.json
new file mode 100644
index 0000000..de24b26
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostsfail1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id":"aaaa",
+ "name": "newName",
+ "cpu": "20",
+ "memory": "8",
+ "disk": "100",
+ "vimId": "123",
+ "vimName": "456"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostssuccess1.json
new file mode 100644
index 0000000..3280951
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/modhostssuccess1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id":"12345678",
+ "name": "hostName",
+ "cpu": "20",
+ "memory": "8",
+ "disk": "100",
+ "vimId": "123",
+ "vimName": "456"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidfail1.json
new file mode 100644
index 0000000..fe528b2
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts/aaaa",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "hosts": []
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidsuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidsuccess1.json
new file mode 100644
index 0000000..0cccaa0
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/hostroa/queryhostsbyidsuccess1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/hosts/12345678",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "hosts": [{
+ "cpu": "20",
+ "disk": "100",
+ "id": "12345678",
+ "memory": "8",
+ "name": "hostName",
+ "vimId": "123",
+ "vimName": "456"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querycpulimitssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querycpulimitssuccess1.json
new file mode 100644
index 0000000..8b24164
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querycpulimitssuccess1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/limits/1234/cpu?vimId=123",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "limits": {
+ "rate": [],
+ "absolute": {
+ "maxTotalVolumes": 1000,
+ "totalVolumesUsed": 14,
+ "maxTotalVolumeGigabytes": 42000,
+ "totalGigabytesUsed":1054
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querydisklimitssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querydisklimitssuccess1.json
new file mode 100644
index 0000000..7da9cdb
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/limitsroa/querydisklimitssuccess1.json
@@ -0,0 +1,21 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/limits/1234/disk?vimId=123",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "vimId": "123",
+ "vimName": "vim1",
+ "limits": {
+ "volumes": 1000,
+ "gigabytes": 42000,
+ "snapshots": 100
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationsfail1.json
new file mode 100644
index 0000000..c490bc9
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationsfail1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "country": "china",
+ "location": "shenzhen",
+ "latitude": "11",
+ "longitude": "22.2",
+ "description": ""
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.base.location.add.entity.check"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationssuccess1.json
new file mode 100644
index 0000000..fb4b97a
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/createlocationssuccess1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "country": "china",
+ "location": "shenzhen",
+ "latitude": "11",
+ "longitude": "22.2",
+ "description": ""
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.add.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationsfail1.json
new file mode 100644
index 0000000..136096d
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationsfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations/aaaa",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationssuccess1.json
new file mode 100644
index 0000000..eaaf8d9
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/deletelocationssuccess1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations/12345678",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationsfail1.json
new file mode 100644
index 0000000..d362898
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationsfail1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "aaaa",
+ "country": "china",
+ "location": "shenzhen",
+ "latitude": "11.1",
+ "longitude": "22.2",
+ "description": ""
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.base.location.update.modified.check"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationssuccess1.json
new file mode 100644
index 0000000..3205272
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/modlocationssuccess1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "country": "china",
+ "location": "shenzhen",
+ "latitude": "11.1",
+ "longitude": "22.2",
+ "description": ""
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidfail1.json
new file mode 100644
index 0000000..b49a37d
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations/aaaa",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "locations": []
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidsuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidsuccess1.json
new file mode 100644
index 0000000..387adc9
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/locationroa/querylocationsbyidsuccess1.json
@@ -0,0 +1,22 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/locations/12345678",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "locations": [{
+ "country": "china",
+ "description": "",
+ "id": "12345678",
+ "latitude": "11",
+ "location": "shenzhen",
+ "longitude": "22.2"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworksfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworksfail1.json
new file mode 100644
index 0000000..014d49f
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworksfail1.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "name": "name1",
+ "tenantId": "111111",
+ "status": "active",
+ "vimId": "123",
+ "vimName": "vimName",
+ "physicalNetwork": "physnet1",
+ "networkType": "vlan",
+ "segmentationId": "26"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.base.network.add.entity.check"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworkssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworkssuccess1.json
new file mode 100644
index 0000000..b909858
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/createnetworkssuccess1.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "name": "name1",
+ "tenantId": "111111",
+ "status": "active",
+ "vimId": "123",
+ "vimName": "vimName",
+ "physicalNetwork": "physnet1",
+ "networkType": "vlan",
+ "segmentationId": "26"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.add.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworksfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworksfail1.json
new file mode 100644
index 0000000..d3a5e5a
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworksfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks?id=aaaa",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworkssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworkssuccess1.json
new file mode 100644
index 0000000..1e56c4b
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/deletenetworkssuccess1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks?id=12345678",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworksfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworksfail1.json
new file mode 100644
index 0000000..2852a2a
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworksfail1.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "aaaa",
+ "name": "newName1",
+ "tenantId": "111111",
+ "status": "active",
+ "vimId": "123",
+ "vimName": "vimName",
+ "physicalNetwork": "physnet1",
+ "networkType": "vlan",
+ "segmentationId": "26"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworkssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworkssuccess1.json
new file mode 100644
index 0000000..fc6aed8
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/modnetworkssuccess1.json
@@ -0,0 +1,26 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "name": "newName1",
+ "tenantId": "111111",
+ "status": "active",
+ "vimId": "123",
+ "vimName": "vimName",
+ "physicalNetwork": "physnet1",
+ "networkType": "vlan",
+ "segmentationId": "26"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidfail1.json
new file mode 100644
index 0000000..ae888cf
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks/aaaa",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "networks": []
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidsuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidsuccess1.json
new file mode 100644
index 0000000..b933eb4
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/networkroa/querynetworksbyidsuccess1.json
@@ -0,0 +1,25 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/networks/12345678",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "networks": [{
+ "id": "12345678",
+ "name": "name1",
+ "tenant_id": "111111",
+ "status": "active",
+ "vimId": "123",
+ "vimName": "vimName",
+ "provider:physical_network": "physnet1",
+ "provider:network_type": "vlan",
+ "provider:segmentation_id": "26"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportsfail1.json
new file mode 100644
index 0000000..7270bf4
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportsfail1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "name": "portName",
+ "networkId": "1111",
+ "status": "ACTIVE",
+ "tenantId": "123456",
+ "vimId": "11",
+ "vimName": "22"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.port.add.id.check"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportssuccess1.json
new file mode 100644
index 0000000..b31d469
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/createportssuccess1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "name": "portName",
+ "networkId": "1111",
+ "status": "ACTIVE",
+ "tenantId": "123456",
+ "vimId": "11",
+ "vimName": "22"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.add.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportsfail1.json
new file mode 100644
index 0000000..c4e3659
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportsfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports?id=aaaa",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportssuccess1.json
new file mode 100644
index 0000000..843593d
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/deleteportssuccess1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports?id=12345678",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportsfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportsfail1.json
new file mode 100644
index 0000000..6c3f521
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportsfail1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "aaaa",
+ "name": "portName",
+ "networkId": "1111",
+ "status": "ACTIVE",
+ "tenantId": "123456",
+ "vimId": "11",
+ "vimName": "22"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportssuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportssuccess1.json
new file mode 100644
index 0000000..583764c
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/modportssuccess1.json
@@ -0,0 +1,24 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "id": "12345678",
+ "name": "newName",
+ "networkId": "1111",
+ "status": "ACTIVE",
+ "tenantId": "123456",
+ "vimId": "11",
+ "vimName": "22"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidfail1.json
new file mode 100644
index 0000000..6a1007f
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports/aaaa",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "ports": []
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidsuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidsuccess1.json
new file mode 100644
index 0000000..4fe360f
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/portroa/queryportsbyidsuccess1.json
@@ -0,0 +1,23 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/ports/12345678",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "ports": [{
+ "id": "12345678",
+ "name": "portName",
+ "networkId": "1111",
+ "status": "ACTIVE",
+ "tenantId": "123456",
+ "vimId": "11",
+ "vimName": "22"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcefail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcefail1.json
new file mode 100644
index 0000000..a604f52
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcefail1.json
@@ -0,0 +1,18 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/resoperate/resmgr/vims?tenantId=1234",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.group.resoperate.add.res.no.vimId"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcesuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcesuccess1.json
new file mode 100644
index 0000000..b23f38f
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/addresourcesuccess1.json
@@ -0,0 +1,18 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/resoperate/resmgr/vims?tenantId=1234&vimId=123",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.add.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcefail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcefail1.json
new file mode 100644
index 0000000..d60484c
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcefail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/resoperate",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.group.resoperate.res.no.vimId"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcesuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcesuccess1.json
new file mode 100644
index 0000000..4b099ae
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/deleteresourcesuccess1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/resoperate?vimId=123",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcefail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcefail1.json
new file mode 100644
index 0000000..0a54e89
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcefail1.json
@@ -0,0 +1,17 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/resoperate/updateres?tenantId=1234",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.group.resoperate.add.res.no.result"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcesuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcesuccess1.json
new file mode 100644
index 0000000..c3196c1
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/resoperateroa/modresourcesuccess1.json
@@ -0,0 +1,17 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/resoperate/updateres?tenantId=1234&vimId=123",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitesfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitesfail1.json
new file mode 100644
index 0000000..5584c1e
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitesfail1.json
@@ -0,0 +1,30 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "country": "china",
+ "id": "12345678",
+ "location": "shanghai",
+ "name": "shanghai",
+ "status": "active",
+ "totalCPU": "100",
+ "totalDisk": "100",
+ "totalMemory": "100",
+ "usedCPU": "10",
+ "usedDisk": "10",
+ "usedMemory": "10",
+ "vimId": "123",
+ "vimName": "vimName"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.service.base.site.add.id.check"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitessuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitessuccess1.json
new file mode 100644
index 0000000..af0d3af
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/createsitessuccess1.json
@@ -0,0 +1,30 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters",
+ "method": "post",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "country": "china",
+ "id": "12345678",
+ "location": "shanghai",
+ "name": "shanghai",
+ "status": "active",
+ "totalCPU": "100",
+ "totalDisk": "100",
+ "totalMemory": "100",
+ "usedCPU": "0",
+ "usedDisk": "0",
+ "usedMemory": "0",
+ "vimId": "123",
+ "vimName": "vimName"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.add.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitesfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitesfail1.json
new file mode 100644
index 0000000..aacd3fe
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitesfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters/aaaa",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitessuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitessuccess1.json
new file mode 100644
index 0000000..d4b083b
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/deletesitessuccess1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters/12345678",
+ "method": "delete",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.del.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitesfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitesfail1.json
new file mode 100644
index 0000000..2c1be4e
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitesfail1.json
@@ -0,0 +1,30 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "country": "china",
+ "id": "aaaa",
+ "location": "shanghai",
+ "name": "newName",
+ "status": "active",
+ "totalCPU": "100",
+ "totalDisk": "100",
+ "totalMemory": "100",
+ "usedCPU": "0",
+ "usedDisk": "0",
+ "usedMemory": "0",
+ "vimId": "123",
+ "vimName": "vimName"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.error"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitessuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitessuccess1.json
new file mode 100644
index 0000000..da19356
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/modsitessuccess1.json
@@ -0,0 +1,30 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters",
+ "method": "put",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ },
+ "json": {
+ "country": "china",
+ "id": "12345678",
+ "location": "shanghai",
+ "name": "newName",
+ "status": "active",
+ "totalCPU": "100",
+ "totalDisk": "100",
+ "totalMemory": "100",
+ "usedCPU": "0",
+ "usedDisk": "0",
+ "usedMemory": "0",
+ "vimId": "123",
+ "vimName": "vimName"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "msg": "org.openo.nfvo.resmanage.common.update.success"
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidfail1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidfail1.json
new file mode 100644
index 0000000..b12b02c
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidfail1.json
@@ -0,0 +1,15 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters/aaaa",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "datacenters": []
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidsuccess1.json b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidsuccess1.json
new file mode 100644
index 0000000..984a7eb
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/testcase/siteroa/querysitesbyidsuccess1.json
@@ -0,0 +1,29 @@
+{
+ "request": {
+ "uri": "/openoapi/resmgr/v1/datacenters/12345678",
+ "method": "get",
+ "headers": {
+ "Content-Type": "application/json;charset=UTF-8"
+ }
+ },
+ "response": {
+ "status": 200,
+ "json": {
+ "datacenters": [{
+ "country": "china",
+ "id": "12345678",
+ "location": "shanghai",
+ "name": "shanghai",
+ "status": "active",
+ "totalCPU": "100",
+ "totalDisk": "100",
+ "totalMemory": "100",
+ "usedCPU": "0",
+ "usedDisk": "0",
+ "usedMemory": "0",
+ "vimId": "123",
+ "vimName": "vimName"
+ }]
+ }
+ }
+} \ No newline at end of file
diff --git a/ResmanagementService/service/src/integration-test/resources/urlconfig.json b/ResmanagementService/service/src/integration-test/resources/urlconfig.json
new file mode 100644
index 0000000..9d07650
--- /dev/null
+++ b/ResmanagementService/service/src/integration-test/resources/urlconfig.json
@@ -0,0 +1,18 @@
+[
+ {
+ "url": "/svc/ipsec/v1",
+ "prefix": "/org.openo.sdno.ipsecservice"
+ },
+ {
+ "url": "/v2.0/tokens",
+ "prefix": ""
+ },
+ {
+ "url": "/v2.0/networks",
+ "prefix": ""
+ },
+ {
+ "url": "/rest/v1/resmanage/virtualnetworks",
+ "prefix": ""
+ }
+] \ No newline at end of file