summaryrefslogtreecommitdiffstats
path: root/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient
diff options
context:
space:
mode:
Diffstat (limited to 'rest-client/src/test/java/org/openo/baseservice/roa/util/restclient')
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestHttpRest.java188
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestHttpContentExchange.java44
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulConfigure.java37
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulFactory.java17
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulOptions.java59
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulParametes.java34
-rw-r--r--rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulResponse.java30
7 files changed, 134 insertions, 275 deletions
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestHttpRest.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestHttpRest.java
index ac8b4a8..47d4ac8 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestHttpRest.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestHttpRest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -19,8 +19,10 @@ package org.openo.baseservice.roa.util.restclient;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.openo.baseservice.remoteservice.exception.ServiceException;
-import org.openo.baseservice.roa.util.ServiceUtil;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
+import java.net.URLEncoder;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpExchange;
@@ -29,18 +31,12 @@ import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
+import org.openo.baseservice.remoteservice.exception.ServiceException;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Field;
-import java.net.URLEncoder;
-
-import mockit.Expectations;
import mockit.Mock;
import mockit.MockUp;
import mockit.Mocked;
@@ -53,7 +49,7 @@ import mockit.integration.junit4.JMockit;
* </p>
*
* @author
- * @version SDNO 0.5 13-Jun-2016
+ * @version 13-Jun-2016
*/
@RunWith(JMockit.class)
public class TestHttpRest {
@@ -65,7 +61,7 @@ public class TestHttpRest {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -75,7 +71,7 @@ public class TestHttpRest {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -85,7 +81,7 @@ public class TestHttpRest {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -95,7 +91,7 @@ public class TestHttpRest {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -105,7 +101,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testInitHttpRest() throws Exception {
@@ -128,7 +124,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testInitHttpRestExcpetion() throws Exception {
@@ -154,7 +150,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testInitHttpRestNull() throws Exception {
@@ -169,7 +165,7 @@ public class TestHttpRest {
*
* @throws NoSuchFieldException
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testCreateRestHttpContentExchange() throws NoSuchFieldException, Exception {
@@ -197,7 +193,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetStringRestfulParametes() throws Exception {
@@ -235,7 +231,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetStringRestfulParametesRestfulOptions() throws Exception {
@@ -266,9 +262,8 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testGetStringRestfulParametesEncodeError() throws Exception {
final RestfulOptions options = new RestfulOptions();
@@ -321,7 +316,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testHeadStringRestfulParametes() throws Exception {
@@ -358,9 +353,8 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testHeadStringRestfulParametesRestfulOptions() throws Exception {
final RestfulOptions options = new RestfulOptions();
@@ -388,20 +382,6 @@ public class TestHttpRest {
parametes.put("address", null);
parametes.putHttpContextHeader("Content-Type", "");
parametes.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(10);
- }
-
- };
final RestfulResponse response = httpRest.head("path/to/service", parametes, options);
assertEquals(HttpExchange.STATUS_COMPLETED, response.getStatus());
}
@@ -412,7 +392,7 @@ public class TestHttpRest {
* @param options
* @return
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
private HttpRest getHttpRest(final RestfulOptions options) throws ServiceException {
final HttpRest httpRest = new HttpRest();
@@ -439,7 +419,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncGetStringRestfulParametesRestfulAsyncCallback() throws Exception {
@@ -486,7 +466,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncGetStringRestfulParametesRestfulOptionsRestfulAsyncCallback() throws ServiceException {
@@ -533,9 +513,8 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testPutStringRestfulParametes() throws ServiceException {
final RestfulOptions options = new RestfulOptions();
@@ -563,20 +542,6 @@ public class TestHttpRest {
parametes.put("address", null);
parametes.putHttpContextHeader("Content-Type", "");
parametes.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(-1);
- }
-
- };
final RestfulResponse response = httpRest.put("path/to/service", parametes);
assertEquals(HttpExchange.STATUS_COMPLETED, response.getStatus());
}
@@ -585,9 +550,8 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testPutStringRestfulParametesRestfulOptions() throws ServiceException {
@@ -616,20 +580,6 @@ public class TestHttpRest {
parametes.put("address", null);
parametes.putHttpContextHeader("Content-Type", "");
parametes.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(10);
- }
-
- };
final RestfulResponse response = httpRest.put("path/to/service", parametes, null);
assertEquals(HttpExchange.STATUS_COMPLETED, response.getStatus());
}
@@ -638,7 +588,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncPutStringRestfulParametesRestfulAsyncCallback() throws ServiceException {
@@ -685,7 +635,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncPutStringRestfulParametesRestfulOptionsRestfulAsyncCallback() throws Exception {
@@ -732,7 +682,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testPostStringRestfulParametes() throws Exception {
@@ -772,9 +722,8 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testPostStringRestfulParametesRestfulOptions() throws ServiceException {
final RestfulOptions options = new RestfulOptions();
@@ -803,20 +752,6 @@ public class TestHttpRest {
parameters.setRawData("{ \"data\"=\"sample JSON data\"");
parameters.putHttpContextHeader("Content-Type", "");
parameters.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(10);
- }
-
- };
thrown.expect(ServiceException.class);
thrown.expectMessage("request is exception");
final RestfulResponse response = httpRest.post("path/to/service", parameters, null);
@@ -827,7 +762,7 @@ public class TestHttpRest {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncPostStringRestfulParametesRestfulAsyncCallback() throws Exception {
@@ -875,7 +810,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncPostStringRestfulParametesRestfulOptionsRestfulAsyncCallback() throws ServiceException {
@@ -923,7 +858,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testDeleteStringRestfulParametes() throws ServiceException {
@@ -939,9 +874,8 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testDeleteStringRestfulParametesRestfulOptions() throws ServiceException {
final RestfulOptions options = new RestfulOptions();
@@ -970,20 +904,6 @@ public class TestHttpRest {
parameters.setRawData("{ \"data\"=\"sample JSON data\"");
parameters.putHttpContextHeader("Content-Type", "");
parameters.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(10);
- }
-
- };
final RestfulResponse response = httpRest.delete("path/to/service", parameters, options);
assertEquals(HttpExchange.STATUS_COMPLETED, response.getStatus());
}
@@ -992,7 +912,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncDeleteStringRestfulParametesRestfulAsyncCallback() throws ServiceException {
@@ -1040,7 +960,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncDeleteStringRestfulParametesRestfulOptionsRestfulAsyncCallback() throws ServiceException {
@@ -1088,9 +1008,8 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testPatchStringRestfulParametes() throws ServiceException {
final RestfulOptions options = new RestfulOptions();
@@ -1119,20 +1038,6 @@ public class TestHttpRest {
parameters.setRawData("{ \"data\"=\"sample JSON data\"");
parameters.putHttpContextHeader("Content-Type", "");
parameters.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(10);
- }
-
- };
final RestfulResponse response = httpRest.patch("path/to/service", parameters);
assertEquals(HttpExchange.STATUS_COMPLETED, response.getStatus());
}
@@ -1141,9 +1046,8 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public void testPatchStringRestfulParametesRestfulOptions() throws ServiceException {
final RestfulOptions options = new RestfulOptions();
@@ -1172,20 +1076,6 @@ public class TestHttpRest {
parameters.setRawData("{ \"data\"=\"sample JSON data\"");
parameters.putHttpContextHeader("Content-Type", "");
parameters.putHttpContextHeader("Accept-Encoding", "");
- new Expectations() {
-
- ServiceUtil serviceUtil;
-
- {
- serviceUtil = new ServiceUtil(anyString, anyString);
- serviceUtil.getServiceHost();
- returns("127.0.0.1");
-
- serviceUtil.getServicePort();
- returns(10);
- }
-
- };
final RestfulResponse response = httpRest.patch("path/to/service", parameters, options);
assertEquals(HttpExchange.STATUS_COMPLETED, response.getStatus());
}
@@ -1194,7 +1084,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncPatchStringRestfulParametesRestfulAsyncCallback() throws ServiceException {
@@ -1242,7 +1132,7 @@ public class TestHttpRest {
* <br/>
*
* @throws ServiceException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testAsyncPatchStringRestfulParametesRestfulOptionsRestfulAsyncCallback() throws ServiceException {
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestHttpContentExchange.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestHttpContentExchange.java
index 094e43d..8575e0c 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestHttpContentExchange.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestHttpContentExchange.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -63,7 +63,7 @@ import mockit.integration.junit4.JMockit;
* </p>
*
* @author
- * @version SDNO 0.5 20-Jun-2016
+ * @version 20-Jun-2016
*/
@RunWith(JMockit.class)
public class TestRestHttpContentExchange {
@@ -78,7 +78,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -88,7 +88,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -98,7 +98,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -108,7 +108,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -119,7 +119,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws IOException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnRequestCommitted() throws IOException {
@@ -137,7 +137,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws IOException
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnRequestComplete() throws IOException {
@@ -155,7 +155,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnResponseComplete() throws Exception {
@@ -199,7 +199,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testDecompressGzipToStr() throws Exception {
@@ -242,7 +242,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testDecompressGzipToStrException() throws Exception {
@@ -294,7 +294,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testDecompressGzipToStrNull() throws Exception {
@@ -314,7 +314,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnResponseHeaderBufferBuffer() throws Exception {
@@ -352,7 +352,7 @@ public class TestRestHttpContentExchange {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnExceptionThrowable() {
@@ -366,7 +366,7 @@ public class TestRestHttpContentExchange {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnExceptionThrowableWithCallback() {
@@ -397,7 +397,7 @@ public class TestRestHttpContentExchange {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnConnectionFailedThrowable() {
@@ -411,7 +411,7 @@ public class TestRestHttpContentExchange {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testOnConnectionFailedThrowableException() {
@@ -442,7 +442,7 @@ public class TestRestHttpContentExchange {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testExpireHttpDestination() {
@@ -457,7 +457,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testExpireHttpDestinationException() throws Exception {
@@ -494,7 +494,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testIsGzip() throws Exception {
@@ -533,7 +533,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetResponse() throws Exception {
@@ -565,7 +565,7 @@ public class TestRestHttpContentExchange {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetResponseGzip() throws Exception {
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulConfigure.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulConfigure.java
index 30b5620..7cc7b1e 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulConfigure.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulConfigure.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -24,8 +24,8 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
+import org.junit.runner.RunWith;
import net.sf.json.JSONObject;
@@ -35,6 +35,7 @@ import java.net.URL;
import mockit.Mock;
import mockit.MockUp;
+import mockit.integration.junit4.JMockit;
/**
* <br/>
@@ -42,15 +43,16 @@ import mockit.MockUp;
* </p>
*
* @author
- * @version SDNO 0.5 20-Jun-2016
+ * @version 20-Jun-2016
*/
+@RunWith(JMockit.class)
public class TestRestfulConfigure {
/**
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -61,7 +63,7 @@ public class TestRestfulConfigure {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -71,7 +73,7 @@ public class TestRestfulConfigure {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -81,7 +83,7 @@ public class TestRestfulConfigure {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -106,11 +108,9 @@ public class TestRestfulConfigure {
/**
* <br/>
- *
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public final void testRestfulConfigure() throws Exception {
final RestfulConfigure configure = new RestfulConfigure();
@@ -126,11 +126,9 @@ public class TestRestfulConfigure {
/**
* <br/>
- *
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public final void testRestfulConfigureAppRootNull() throws Exception {
new MockUp<SystemEnvVariablesDefImpl>() {
@@ -157,9 +155,8 @@ public class TestRestfulConfigure {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public final void testRestfulConfigureDefault() throws Exception {
@@ -188,9 +185,8 @@ public class TestRestfulConfigure {
* <br/>
*
* @throws Exception
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public final void testRestfulConfigureException() throws Exception {
@@ -214,11 +210,9 @@ public class TestRestfulConfigure {
}
/**
- * <br/>
*
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public final void testRestfulConfigureString() {
final String configFile = "rest-client-test.json";
@@ -236,9 +230,8 @@ public class TestRestfulConfigure {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
- @Ignore
@Test
public final void testGetOptions() {
}
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulFactory.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulFactory.java
index 70c7dea..5678732 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulFactory.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -26,9 +26,11 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.junit.runner.RunWith;
import mockit.Mock;
import mockit.MockUp;
+import mockit.integration.junit4.JMockit;
/**
* <br/>
@@ -36,15 +38,16 @@ import mockit.MockUp;
* </p>
*
* @author
- * @version SDNO 0.5 21-Jun-2016
+ * @version 21-Jun-2016
*/
+@RunWith(JMockit.class)
public class TestRestfulFactory {
/**
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -54,7 +57,7 @@ public class TestRestfulFactory {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -64,7 +67,7 @@ public class TestRestfulFactory {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -74,7 +77,7 @@ public class TestRestfulFactory {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -83,7 +86,7 @@ public class TestRestfulFactory {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRestInstance() {
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulOptions.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulOptions.java
index 624f54c..b91bbef 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulOptions.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulOptions.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -43,7 +43,7 @@ import mockit.integration.junit4.JMockit;
* </p>
*
* @author
- * @version SDNO 0.5 20-Jun-2016
+ * @version 20-Jun-2016
*/
@RunWith(JMockit.class)
public class TestRestfulOptions {
@@ -55,7 +55,7 @@ public class TestRestfulOptions {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -65,7 +65,7 @@ public class TestRestfulOptions {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -75,7 +75,7 @@ public class TestRestfulOptions {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -85,7 +85,7 @@ public class TestRestfulOptions {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -94,34 +94,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
- */
- @Test
- public void testSetCalledServiceName() {
- final RestfulOptions options = new RestfulOptions();
- final String serviceName = "sample-service";
- assertTrue(options.setCalledServiceName(serviceName));
- assertEquals(serviceName, options.getCalledServicName());
- }
-
- /**
- * <br/>
- *
- * @since SDNO 0.5
- */
- @Test
- public void testGetCalledServicName() {
- final RestfulOptions options = new RestfulOptions();
- final String serviceName = "sample-service";
- assertEquals("", options.getCalledServicName());
- options.setCalledServiceName(serviceName);
- assertEquals(serviceName, options.getCalledServicName());
- }
-
- /**
- * <br/>
- *
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetPort() {
@@ -135,7 +108,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetPort() {
@@ -148,7 +121,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetHost() {
@@ -162,7 +135,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetHost() {
@@ -175,7 +148,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetRestTimeout() {
@@ -207,7 +180,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRestTimeout() {
@@ -223,7 +196,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetOption() {
@@ -248,7 +221,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetIntOption() {
@@ -270,7 +243,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetStringOption() {
@@ -291,7 +264,7 @@ public class TestRestfulOptions {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetOption() {
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulParametes.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulParametes.java
index fd6fd9f..fbe9430 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulParametes.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulParametes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -34,7 +34,7 @@ import java.util.Map;
* </p>
*
* @author
- * @version SDNO 0.5 21-Jun-2016
+ * @version 21-Jun-2016
*/
public class TestRestfulParametes {
@@ -42,7 +42,7 @@ public class TestRestfulParametes {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -52,7 +52,7 @@ public class TestRestfulParametes {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -62,7 +62,7 @@ public class TestRestfulParametes {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -72,7 +72,7 @@ public class TestRestfulParametes {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -81,7 +81,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGet() {
@@ -96,7 +96,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetRawData() {
@@ -109,7 +109,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRawData() {
@@ -123,7 +123,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testPut() {
@@ -137,7 +137,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testPutHttpContextHeaderStringString() {
@@ -149,7 +149,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testPutHttpContextHeaderStringInt() {
@@ -161,7 +161,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetHttpContextHeader() {
@@ -175,7 +175,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetParamMap() {
@@ -188,7 +188,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetParamMap() {
@@ -203,7 +203,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetHeaderMap() {
@@ -216,7 +216,7 @@ public class TestRestfulParametes {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetHeaderMap() {
diff --git a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulResponse.java b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulResponse.java
index c837aec..19fc7d5 100644
--- a/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulResponse.java
+++ b/rest-client/src/test/java/org/openo/baseservice/roa/util/restclient/TestRestfulResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Huawei Technologies Co., Ltd.
+ * 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.
@@ -39,7 +39,7 @@ import java.util.Map;
* </p>
*
* @author
- * @version SDNO 0.5 20-Jun-2016
+ * @version 20-Jun-2016
*/
public class TestRestfulResponse {
@@ -50,7 +50,7 @@ public class TestRestfulResponse {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -60,7 +60,7 @@ public class TestRestfulResponse {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
@@ -70,7 +70,7 @@ public class TestRestfulResponse {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@Before
public void setUp() throws Exception {
@@ -80,7 +80,7 @@ public class TestRestfulResponse {
* <br/>
*
* @throws java.lang.Exception
- * @since SDNO 0.5
+ * @since
*/
@After
public void tearDown() throws Exception {
@@ -89,7 +89,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetStatus() {
@@ -107,7 +107,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetStatus() {
@@ -121,7 +121,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRespHeaderMap() {
@@ -140,7 +140,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetRespHeaderMap() {
@@ -159,7 +159,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRespHeaderInt() {
@@ -186,7 +186,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRespHeaderLong() {
@@ -220,7 +220,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetRespHeaderStr() {
@@ -244,7 +244,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testGetResponseContent() {
@@ -259,7 +259,7 @@ public class TestRestfulResponse {
/**
* <br/>
*
- * @since SDNO 0.5
+ * @since
*/
@Test
public void testSetResponseJson() {