Replace Grizzly2 test container to Jetty test container

Grizzly2 test framework does not produce the same test results
compare to production REST API test through jetty web server.
By default Jersey 2.x uses the Grizzly2 test framework, this
commit tries to replace this test framework to Jetty based
http test framework.

Change-Id: I7bcb19bf73801cc66036487fd5a964e32ce1ba61
diff --git a/web/api/pom.xml b/web/api/pom.xml
index 31eacc8..0858ff1 100644
--- a/web/api/pom.xml
+++ b/web/api/pom.xml
@@ -53,6 +53,11 @@
             <scope>test</scope>
             <classifier>tests</classifier>
         </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.test-framework.providers</groupId>
+            <artifactId>jersey-test-framework-provider-jetty</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <properties>
diff --git a/web/api/src/test/java/org/onosproject/rest/resources/ResourceTest.java b/web/api/src/test/java/org/onosproject/rest/resources/ResourceTest.java
index dfe6360..5305a8a 100644
--- a/web/api/src/test/java/org/onosproject/rest/resources/ResourceTest.java
+++ b/web/api/src/test/java/org/onosproject/rest/resources/ResourceTest.java
@@ -17,12 +17,16 @@
 
 import org.glassfish.jersey.server.ResourceConfig;
 import org.glassfish.jersey.test.JerseyTest;
+import org.glassfish.jersey.test.jetty.JettyTestContainerFactory;
+import org.glassfish.jersey.test.spi.TestContainerException;
+import org.glassfish.jersey.test.spi.TestContainerFactory;
 
 import java.io.IOException;
 import java.net.ServerSocket;
 
 /**
- * Base class for REST API tests.  Performs common configuration operations.
+ * Base class for REST API tests.
+ * Performs common configuration operations.
  */
 public class ResourceTest extends JerseyTest {
     private static final int DEFAULT_PORT = 9998;
@@ -61,4 +65,15 @@
             return defaultPort;
         }
     }
+
+    /**
+     * Configures the jetty test container as default test container.
+     *
+     * @return test container factory
+     * @throws TestContainerException
+     */
+    @Override
+    protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
+        return new JettyTestContainerFactory();
+    }
 }
diff --git a/web/pom.xml b/web/pom.xml
index 5961dbc..0a053c6 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -95,7 +95,7 @@
         </dependency>
         <dependency>
             <groupId>org.glassfish.jersey.test-framework.providers</groupId>
-            <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
+            <artifactId>jersey-test-framework-provider-jetty</artifactId>
             <scope>test</scope>
         </dependency>