Committed by
Gerrit Code Review
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
Showing
11 changed files
with
130 additions
and
73 deletions
| ... | @@ -106,7 +106,7 @@ | ... | @@ -106,7 +106,7 @@ |
| 106 | </dependency> | 106 | </dependency> |
| 107 | <dependency> | 107 | <dependency> |
| 108 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> | 108 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> |
| 109 | - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> | 109 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> |
| 110 | <scope>test</scope> | 110 | <scope>test</scope> |
| 111 | </dependency> | 111 | </dependency> |
| 112 | 112 | ... | ... |
| ... | @@ -144,7 +144,7 @@ | ... | @@ -144,7 +144,7 @@ |
| 144 | </dependency> | 144 | </dependency> |
| 145 | <dependency> | 145 | <dependency> |
| 146 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> | 146 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> |
| 147 | - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> | 147 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> |
| 148 | <scope>test</scope> | 148 | <scope>test</scope> |
| 149 | </dependency> | 149 | </dependency> |
| 150 | <dependency> | 150 | <dependency> | ... | ... |
| ... | @@ -15,7 +15,7 @@ COMPILE_DEPS = [ | ... | @@ -15,7 +15,7 @@ COMPILE_DEPS = [ |
| 15 | TEST_DEPS = [ | 15 | TEST_DEPS = [ |
| 16 | '//lib:TEST_ADAPTERS', | 16 | '//lib:TEST_ADAPTERS', |
| 17 | '//lib:jersey-test-framework-core', | 17 | '//lib:jersey-test-framework-core', |
| 18 | - '//lib:jersey-test-framework-grizzly2', | 18 | + '//lib:jersey-test-framework-jetty', |
| 19 | '//utils/osgi:onlab-osgi-tests', | 19 | '//utils/osgi:onlab-osgi-tests', |
| 20 | '//web/api:onos-rest-tests', | 20 | '//web/api:onos-rest-tests', |
| 21 | '//incubator/api:onos-incubator-api-tests', | 21 | '//incubator/api:onos-incubator-api-tests', | ... | ... |
| ... | @@ -77,7 +77,7 @@ | ... | @@ -77,7 +77,7 @@ |
| 77 | </dependency> | 77 | </dependency> |
| 78 | <dependency> | 78 | <dependency> |
| 79 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> | 79 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> |
| 80 | - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> | 80 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> |
| 81 | <scope>test</scope> | 81 | <scope>test</scope> |
| 82 | </dependency> | 82 | </dependency> |
| 83 | </dependencies> | 83 | </dependencies> | ... | ... |
| ... | @@ -81,17 +81,20 @@ java_library( | ... | @@ -81,17 +81,20 @@ java_library( |
| 81 | ':jersey-server', | 81 | ':jersey-server', |
| 82 | ':jersey-common', | 82 | ':jersey-common', |
| 83 | ':jersey-test-framework-core', | 83 | ':jersey-test-framework-core', |
| 84 | - ':jersey-test-framework-grizzly2', | 84 | + ':jersey-test-framework-jetty', |
| 85 | + ':jersey-container-jetty-http', | ||
| 86 | + ':jetty-continuation', | ||
| 87 | + ':jetty-http', | ||
| 88 | + ':javax.servlet-api', | ||
| 89 | + ':jetty-server', | ||
| 90 | + ':jetty-io', | ||
| 91 | + ':jetty-util', | ||
| 85 | ':jersey-guava', | 92 | ':jersey-guava', |
| 86 | ':hk2-api', | 93 | ':hk2-api', |
| 87 | ':hk2-locator', | 94 | ':hk2-locator', |
| 88 | ':hk2-utils', | 95 | ':hk2-utils', |
| 89 | ':javax.inject', | 96 | ':javax.inject', |
| 90 | ':hk2-osgi-resource-locator', | 97 | ':hk2-osgi-resource-locator', |
| 91 | - ':jersey-container-grizzly2-http', | ||
| 92 | - ':grizzly-http-server', | ||
| 93 | - ':grizzly-framework', | ||
| 94 | - ':grizzly-http', | ||
| 95 | ':javax.annotation-api', | 98 | ':javax.annotation-api', |
| 96 | ':validation-api', | 99 | ':validation-api', |
| 97 | '//core/common:onos-core-common', | 100 | '//core/common:onos-core-common', |
| ... | @@ -592,45 +595,87 @@ remote_file( | ... | @@ -592,45 +595,87 @@ remote_file( |
| 592 | ) | 595 | ) |
| 593 | 596 | ||
| 594 | prebuilt_jar( | 597 | prebuilt_jar( |
| 595 | - name = 'grizzly-framework', | 598 | + name = 'jetty-server', |
| 596 | - binary_jar = ':grizzly-framework-2.3.23.jar', | 599 | + binary_jar = ':jetty-server-9.1.6.v20160112.jar', |
| 597 | - maven_coords = 'org.glassfish.grizzly:grizzly-framework:2.3.23', | 600 | + maven_coords = 'org.eclipse.jetty:jetty-server:9.1.6.v20160112', |
| 598 | visibility = [ 'PUBLIC' ], | 601 | visibility = [ 'PUBLIC' ], |
| 599 | ) | 602 | ) |
| 600 | 603 | ||
| 601 | remote_file( | 604 | remote_file( |
| 602 | - name = 'grizzly-framework-2.3.23.jar', | 605 | + name = 'jetty-server-9.1.6.v20160112.jar', |
| 603 | - out = 'grizzly-framework-2.3.23.jar', | 606 | + out = 'jetty-server-9.1.6.v20160112.jar', |
| 604 | - url = 'mvn:org.glassfish.grizzly:grizzly-framework:jar:2.3.23', | 607 | + url = 'mvn:org.eclipse.jetty:jetty-server:jar:9.1.6.v20160112', |
| 605 | - sha1 = '262913b1a7ec4156e7e6aa3f8854a4d1a54940b0', | 608 | + sha1 = '15f8b12fe0e2105f46d7c3b372054adc85e941a9', |
| 606 | ) | 609 | ) |
| 607 | 610 | ||
| 608 | prebuilt_jar( | 611 | prebuilt_jar( |
| 609 | - name = 'grizzly-http', | 612 | + name = 'jetty-util', |
| 610 | - binary_jar = ':grizzly-http-2.3.23.jar', | 613 | + binary_jar = ':jetty-util-9.1.6.v20160112.jar', |
| 611 | - maven_coords = 'org.glassfish.grizzly:grizzly-http:2.3.23', | 614 | + maven_coords = 'org.eclipse.jetty:jetty-util:9.1.6.v20160112', |
| 615 | + visibility = [ 'PUBLIC' ], | ||
| 616 | +) | ||
| 617 | + | ||
| 618 | +remote_file( | ||
| 619 | + name = 'jetty-util-9.1.6.v20160112.jar', | ||
| 620 | + out = 'jetty-util-9.1.6.v20160112.jar', | ||
| 621 | + url = 'mvn:org.eclipse.jetty:jetty-util:jar:9.1.6.v20160112', | ||
| 622 | + sha1 = 'd4337bc023fe99b072abc56425b8a317ffd3f462', | ||
| 623 | +) | ||
| 624 | + | ||
| 625 | +prebuilt_jar( | ||
| 626 | + name = 'jetty-continuation', | ||
| 627 | + binary_jar = ':jetty-continuation-9.1.6.v20160112.jar', | ||
| 628 | + maven_coords = 'org.eclipse.jetty:jetty-continuation:9.1.6.v20160112', | ||
| 629 | + visibility = [ 'PUBLIC' ], | ||
| 630 | +) | ||
| 631 | + | ||
| 632 | +remote_file( | ||
| 633 | + name = 'jetty-continuation-9.1.6.v20160112.jar', | ||
| 634 | + out = 'jetty-continuation-9.1.6.v20160112.jar', | ||
| 635 | + url = 'mvn:org.eclipse.jetty:jetty-continuation:jar:9.1.6.v20160112', | ||
| 636 | + sha1 = 'c8f35dfc6321cc15224404c9c4ede79988eeae34', | ||
| 637 | +) | ||
| 638 | + | ||
| 639 | +prebuilt_jar( | ||
| 640 | + name = 'jetty-http', | ||
| 641 | + binary_jar = ':jetty-http-9.1.6.v20160112.jar', | ||
| 642 | + maven_coords = 'org.eclipse.jetty:jetty-http:9.1.6.v20160112', | ||
| 612 | visibility = [ 'PUBLIC' ], | 643 | visibility = [ 'PUBLIC' ], |
| 613 | ) | 644 | ) |
| 614 | 645 | ||
| 615 | remote_file( | 646 | remote_file( |
| 616 | - name = 'grizzly-http-2.3.23.jar', | 647 | + name = 'jetty-http-9.1.6.v20160112.jar', |
| 617 | - out = 'grizzly-http-2.3.23.jar', | 648 | + out = 'jetty-http-9.1.6.v20160112.jar', |
| 618 | - url = 'mvn:org.glassfish.grizzly:grizzly-http:jar:2.3.23', | 649 | + url = 'mvn:org.eclipse.jetty:jetty-http:jar:9.1.6.v20160112', |
| 619 | - sha1 = '287ea2c8a765b14fbc494749570ff3889ecd7b83', | 650 | + sha1 = 'c3675e6ebc350aafbc9dd7686265af9f65165b36', |
| 620 | ) | 651 | ) |
| 621 | 652 | ||
| 622 | prebuilt_jar( | 653 | prebuilt_jar( |
| 623 | - name = 'grizzly-http-server', | 654 | + name = 'jetty-io', |
| 624 | - binary_jar = ':grizzly-http-server-2.3.23.jar', | 655 | + binary_jar = ':jetty-io-9.1.6.v20160112.jar', |
| 625 | - maven_coords = 'org.glassfish.grizzly:grizzly-http-server:2.3.23', | 656 | + maven_coords = 'org.eclipse.jetty:jetty-io:9.1.6.v20160112', |
| 626 | visibility = [ 'PUBLIC' ], | 657 | visibility = [ 'PUBLIC' ], |
| 627 | ) | 658 | ) |
| 628 | 659 | ||
| 629 | remote_file( | 660 | remote_file( |
| 630 | - name = 'grizzly-http-server-2.3.23.jar', | 661 | + name = 'jetty-io-9.1.6.v20160112.jar', |
| 631 | - out = 'grizzly-http-server-2.3.23.jar', | 662 | + out = 'jetty-io-9.1.6.v20160112.jar', |
| 632 | - url = 'mvn:org.glassfish.grizzly:grizzly-http-server:jar:2.3.23', | 663 | + url = 'mvn:org.eclipse.jetty:jetty-io:jar:9.1.6.v20160112', |
| 633 | - sha1 = '4aaf209163d8dca1bfb1907f19c7fd1f2f3ebbf9', | 664 | + sha1 = '717fc5a269becb2537849105de1547dc1a4476b0', |
| 665 | +) | ||
| 666 | + | ||
| 667 | +prebuilt_jar( | ||
| 668 | + name = 'javax.servlet-api', | ||
| 669 | + binary_jar = ':javax.servlet-api-3.1.0.jar', | ||
| 670 | + maven_coords = 'javax.servlet:javax.servlet-api:3.1.0', | ||
| 671 | + visibility = [ 'PUBLIC' ], | ||
| 672 | +) | ||
| 673 | + | ||
| 674 | +remote_file( | ||
| 675 | + name = 'javax.servlet-api-3.1.0.jar', | ||
| 676 | + out = 'javax.servlet-api-3.1.0.jar', | ||
| 677 | + url = 'mvn:javax.servlet:javax.servlet-api:jar:3.1.0', | ||
| 678 | + sha1 = '3cd63d075497751784b2fa84be59432f4905bf7c', | ||
| 634 | ) | 679 | ) |
| 635 | 680 | ||
| 636 | prebuilt_jar( | 681 | prebuilt_jar( |
| ... | @@ -914,17 +959,17 @@ remote_file( | ... | @@ -914,17 +959,17 @@ remote_file( |
| 914 | ) | 959 | ) |
| 915 | 960 | ||
| 916 | prebuilt_jar( | 961 | prebuilt_jar( |
| 917 | - name = 'jersey-container-grizzly2-http', | 962 | + name = 'jersey-container-jetty-http', |
| 918 | - binary_jar = ':jersey-container-grizzly2-http-2.22.2.jar', | 963 | + binary_jar = ':jersey-container-jetty-http-2.22.2.jar', |
| 919 | - maven_coords = 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.22.2', | 964 | + maven_coords = 'org.glassfish.jersey.containers:jersey-container-jetty-http:2.22.2', |
| 920 | visibility = [ 'PUBLIC' ], | 965 | visibility = [ 'PUBLIC' ], |
| 921 | ) | 966 | ) |
| 922 | 967 | ||
| 923 | remote_file( | 968 | remote_file( |
| 924 | - name = 'jersey-container-grizzly2-http-2.22.2.jar', | 969 | + name = 'jersey-container-jetty-http-2.22.2.jar', |
| 925 | - out = 'jersey-container-grizzly2-http-2.22.2.jar', | 970 | + out = 'jersey-container-jetty-http-2.22.2.jar', |
| 926 | - url = 'mvn:org.glassfish.jersey.containers:jersey-container-grizzly2-http:jar:2.22.2', | 971 | + url = 'mvn:org.glassfish.jersey.containers:jersey-container-jetty-http:jar:2.22.2', |
| 927 | - sha1 = '7f4f0cb7cfad277a4a6d91298d9f2ac309e4383b', | 972 | + sha1 = '7421abf505bda989087745a458b5ccf2cd327297', |
| 928 | ) | 973 | ) |
| 929 | 974 | ||
| 930 | prebuilt_jar( | 975 | prebuilt_jar( |
| ... | @@ -984,31 +1029,17 @@ remote_file( | ... | @@ -984,31 +1029,17 @@ remote_file( |
| 984 | ) | 1029 | ) |
| 985 | 1030 | ||
| 986 | prebuilt_jar( | 1031 | prebuilt_jar( |
| 987 | - name = 'jersey-test-framework-grizzly2', | 1032 | + name = 'jersey-test-framework-jetty', |
| 988 | - binary_jar = ':jersey-test-framework-provider-grizzly2-2.22.2.jar', | 1033 | + binary_jar = ':jersey-test-framework-provider-jetty-2.22.2.jar', |
| 989 | - maven_coords = 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.22.2', | 1034 | + maven_coords = 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:2.22.2', |
| 990 | - visibility = [ 'PUBLIC' ], | ||
| 991 | -) | ||
| 992 | - | ||
| 993 | -remote_file( | ||
| 994 | - name = 'jersey-test-framework-provider-grizzly2-2.22.2.jar', | ||
| 995 | - out = 'jersey-test-framework-provider-grizzly2-2.22.2.jar', | ||
| 996 | - url = 'mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:jar:2.22.2', | ||
| 997 | - sha1 = '05aa3952528f09ce94360ab238446163d2544344', | ||
| 998 | -) | ||
| 999 | - | ||
| 1000 | -prebuilt_jar( | ||
| 1001 | - name = 'jetty-util', | ||
| 1002 | - binary_jar = ':jetty-util-8.1.18.v20150929.jar', | ||
| 1003 | - maven_coords = 'org.eclipse.jetty:jetty-util:8.1.18.v20150929', | ||
| 1004 | visibility = [ 'PUBLIC' ], | 1035 | visibility = [ 'PUBLIC' ], |
| 1005 | ) | 1036 | ) |
| 1006 | 1037 | ||
| 1007 | remote_file( | 1038 | remote_file( |
| 1008 | - name = 'jetty-util-8.1.18.v20150929.jar', | 1039 | + name = 'jersey-test-framework-provider-jetty-2.22.2.jar', |
| 1009 | - out = 'jetty-util-8.1.18.v20150929.jar', | 1040 | + out = 'jersey-test-framework-provider-jetty-2.22.2.jar', |
| 1010 | - url = 'mvn:org.eclipse.jetty:jetty-util:jar:8.1.18.v20150929', | 1041 | + url = 'mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:jar:2.22.2', |
| 1011 | - sha1 = 'fb8fb3debf99a626c827535bf06451a337c6b085', | 1042 | + sha1 = 'ab3b0418403f6a5cfc311f92b7cd589dc32f60ed', |
| 1012 | ) | 1043 | ) |
| 1013 | 1044 | ||
| 1014 | prebuilt_jar( | 1045 | prebuilt_jar( | ... | ... |
| ... | @@ -59,17 +59,20 @@ | ... | @@ -59,17 +59,20 @@ |
| 59 | "jersey-server", | 59 | "jersey-server", |
| 60 | "jersey-common", | 60 | "jersey-common", |
| 61 | "jersey-test-framework-core", | 61 | "jersey-test-framework-core", |
| 62 | - "jersey-test-framework-grizzly2", | 62 | + "jersey-test-framework-jetty", |
| 63 | + "jersey-container-jetty-http", | ||
| 64 | + "jetty-continuation", | ||
| 65 | + "jetty-http", | ||
| 66 | + "jetty-server", | ||
| 67 | + "jetty-io", | ||
| 68 | + "jetty-util", | ||
| 69 | + "javax.servlet-api", | ||
| 63 | "jersey-guava", | 70 | "jersey-guava", |
| 64 | "hk2-api", | 71 | "hk2-api", |
| 65 | "hk2-locator", | 72 | "hk2-locator", |
| 66 | "hk2-utils", | 73 | "hk2-utils", |
| 67 | "javax.inject", | 74 | "javax.inject", |
| 68 | "hk2-osgi-resource-locator", | 75 | "hk2-osgi-resource-locator", |
| 69 | - "jersey-container-grizzly2-http", | ||
| 70 | - "grizzly-http-server", | ||
| 71 | - "grizzly-framework", | ||
| 72 | - "grizzly-http", | ||
| 73 | "javax.annotation-api", | 76 | "javax.annotation-api", |
| 74 | "validation-api", | 77 | "validation-api", |
| 75 | "//core/common:onos-core-common", | 78 | "//core/common:onos-core-common", |
| ... | @@ -115,9 +118,7 @@ | ... | @@ -115,9 +118,7 @@ |
| 115 | "easymock": "mvn:org.easymock:easymock:3.4", | 118 | "easymock": "mvn:org.easymock:easymock:3.4", |
| 116 | "error_prone_annotations": "mvn:com.google.errorprone:error_prone_annotations:2.0.2", | 119 | "error_prone_annotations": "mvn:com.google.errorprone:error_prone_annotations:2.0.2", |
| 117 | "ganymed-ssh2": "mvn:ch.ethz.ganymed:ganymed-ssh2:262", | 120 | "ganymed-ssh2": "mvn:ch.ethz.ganymed:ganymed-ssh2:262", |
| 118 | - "grizzly-framework": "mvn:org.glassfish.grizzly:grizzly-framework:2.3.23", | 121 | + "jersey-container-jetty-http": "mvn:org.glassfish.jersey.containers:jersey-container-jetty-http:2.22.2", |
| 119 | - "grizzly-http": "mvn:org.glassfish.grizzly:grizzly-http:2.3.23", | ||
| 120 | - "grizzly-http-server": "mvn:org.glassfish.grizzly:grizzly-http-server:2.3.23", | ||
| 121 | "guava": "mvn:com.google.guava:guava:19.0", | 122 | "guava": "mvn:com.google.guava:guava:19.0", |
| 122 | "guava-testlib": "mvn:com.google.guava:guava-testlib:19.0", | 123 | "guava-testlib": "mvn:com.google.guava:guava-testlib:19.0", |
| 123 | "hamcrest-all": "mvn:org.hamcrest:hamcrest-all:1.3", | 124 | "hamcrest-all": "mvn:org.hamcrest:hamcrest-all:1.3", |
| ... | @@ -138,14 +139,19 @@ | ... | @@ -138,14 +139,19 @@ |
| 138 | "javax.ws.rs-api": "mvn:javax.ws.rs:javax.ws.rs-api:2.0.1", | 139 | "javax.ws.rs-api": "mvn:javax.ws.rs:javax.ws.rs-api:2.0.1", |
| 139 | "jersey-client": "mvn:org.glassfish.jersey.core:jersey-client:2.22.2", | 140 | "jersey-client": "mvn:org.glassfish.jersey.core:jersey-client:2.22.2", |
| 140 | "jersey-common": "mvn:org.glassfish.jersey.core:jersey-common:2.22.2", | 141 | "jersey-common": "mvn:org.glassfish.jersey.core:jersey-common:2.22.2", |
| 141 | - "jersey-container-grizzly2-http": "mvn:org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.22.2", | ||
| 142 | "jersey-guava": "mvn:org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22.2", | 142 | "jersey-guava": "mvn:org.glassfish.jersey.bundles.repackaged:jersey-guava:2.22.2", |
| 143 | "jersey-media-multipart": "mvn:org.glassfish.jersey.media:jersey-media-multipart:2.22.2", | 143 | "jersey-media-multipart": "mvn:org.glassfish.jersey.media:jersey-media-multipart:2.22.2", |
| 144 | "jersey-server": "mvn:org.glassfish.jersey.core:jersey-server:2.22.2", | 144 | "jersey-server": "mvn:org.glassfish.jersey.core:jersey-server:2.22.2", |
| 145 | "jersey-test-framework-core": "mvn:org.glassfish.jersey.test-framework:jersey-test-framework-core:2.22.2", | 145 | "jersey-test-framework-core": "mvn:org.glassfish.jersey.test-framework:jersey-test-framework-core:2.22.2", |
| 146 | - "jersey-test-framework-grizzly2": "mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.22.2", | 146 | + "jersey-test-framework-jetty": "mvn:org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty:2.22.2", |
| 147 | - "jetty-util": "mvn:org.eclipse.jetty:jetty-util:8.1.18.v20150929", | 147 | + "jetty-util": "mvn:org.eclipse.jetty:jetty-util:9.1.6.v20160112", |
| 148 | "jetty-websocket": "mvn:org.eclipse.jetty:jetty-websocket:8.1.18.v20150929", | 148 | "jetty-websocket": "mvn:org.eclipse.jetty:jetty-websocket:8.1.18.v20150929", |
| 149 | + "jetty-server": "mvn:org.eclipse.jetty:jetty-server:9.1.6.v20160112", | ||
| 150 | + "jetty-continuation": "mvn:org.eclipse.jetty:jetty-continuation:9.1.6.v20160112", | ||
| 151 | + "jetty-http": "mvn:org.eclipse.jetty:jetty-http:9.1.6.v20160112", | ||
| 152 | + "jetty-io": "mvn:org.eclipse.jetty:jetty-io:9.1.6.v20160112", | ||
| 153 | + "jetty-server": "mvn:org.eclipse.jetty:jetty-server:9.1.6.v20160112", | ||
| 154 | + "javax.servlet-api": "mvn:javax.servlet:javax.servlet-api:3.1.0", | ||
| 149 | "joda-time": "mvn:joda-time:joda-time:2.9", | 155 | "joda-time": "mvn:joda-time:joda-time:2.9", |
| 150 | "jsch": "mvn:com.jcraft:jsch:0.1.53", | 156 | "jsch": "mvn:com.jcraft:jsch:0.1.53", |
| 151 | "jsr305": "mvn:com.google.code.findbugs:jsr305:3.0.1", | 157 | "jsr305": "mvn:com.google.code.findbugs:jsr305:3.0.1", | ... | ... |
| ... | @@ -261,7 +261,7 @@ | ... | @@ -261,7 +261,7 @@ |
| 261 | </dependency> | 261 | </dependency> |
| 262 | <dependency> | 262 | <dependency> |
| 263 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> | 263 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> |
| 264 | - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> | 264 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> |
| 265 | <version>${jersey.version}</version> | 265 | <version>${jersey.version}</version> |
| 266 | <scope>test</scope> | 266 | <scope>test</scope> |
| 267 | </dependency> | 267 | </dependency> | ... | ... |
| ... | @@ -58,7 +58,7 @@ | ... | @@ -58,7 +58,7 @@ |
| 58 | </dependency> | 58 | </dependency> |
| 59 | <dependency> | 59 | <dependency> |
| 60 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> | 60 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> |
| 61 | - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> | 61 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> |
| 62 | <scope>test</scope> | 62 | <scope>test</scope> |
| 63 | </dependency> | 63 | </dependency> |
| 64 | <dependency> | 64 | <dependency> | ... | ... |
| ... | @@ -53,6 +53,11 @@ | ... | @@ -53,6 +53,11 @@ |
| 53 | <scope>test</scope> | 53 | <scope>test</scope> |
| 54 | <classifier>tests</classifier> | 54 | <classifier>tests</classifier> |
| 55 | </dependency> | 55 | </dependency> |
| 56 | + <dependency> | ||
| 57 | + <groupId>org.glassfish.jersey.test-framework.providers</groupId> | ||
| 58 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> | ||
| 59 | + <scope>test</scope> | ||
| 60 | + </dependency> | ||
| 56 | </dependencies> | 61 | </dependencies> |
| 57 | 62 | ||
| 58 | <properties> | 63 | <properties> | ... | ... |
| ... | @@ -17,12 +17,16 @@ package org.onosproject.rest.resources; | ... | @@ -17,12 +17,16 @@ package org.onosproject.rest.resources; |
| 17 | 17 | ||
| 18 | import org.glassfish.jersey.server.ResourceConfig; | 18 | import org.glassfish.jersey.server.ResourceConfig; |
| 19 | import org.glassfish.jersey.test.JerseyTest; | 19 | import org.glassfish.jersey.test.JerseyTest; |
| 20 | +import org.glassfish.jersey.test.jetty.JettyTestContainerFactory; | ||
| 21 | +import org.glassfish.jersey.test.spi.TestContainerException; | ||
| 22 | +import org.glassfish.jersey.test.spi.TestContainerFactory; | ||
| 20 | 23 | ||
| 21 | import java.io.IOException; | 24 | import java.io.IOException; |
| 22 | import java.net.ServerSocket; | 25 | import java.net.ServerSocket; |
| 23 | 26 | ||
| 24 | /** | 27 | /** |
| 25 | - * Base class for REST API tests. Performs common configuration operations. | 28 | + * Base class for REST API tests. |
| 29 | + * Performs common configuration operations. | ||
| 26 | */ | 30 | */ |
| 27 | public class ResourceTest extends JerseyTest { | 31 | public class ResourceTest extends JerseyTest { |
| 28 | private static final int DEFAULT_PORT = 9998; | 32 | private static final int DEFAULT_PORT = 9998; |
| ... | @@ -61,4 +65,15 @@ public class ResourceTest extends JerseyTest { | ... | @@ -61,4 +65,15 @@ public class ResourceTest extends JerseyTest { |
| 61 | return defaultPort; | 65 | return defaultPort; |
| 62 | } | 66 | } |
| 63 | } | 67 | } |
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * Configures the jetty test container as default test container. | ||
| 71 | + * | ||
| 72 | + * @return test container factory | ||
| 73 | + * @throws TestContainerException | ||
| 74 | + */ | ||
| 75 | + @Override | ||
| 76 | + protected TestContainerFactory getTestContainerFactory() throws TestContainerException { | ||
| 77 | + return new JettyTestContainerFactory(); | ||
| 78 | + } | ||
| 64 | } | 79 | } | ... | ... |
| ... | @@ -95,7 +95,7 @@ | ... | @@ -95,7 +95,7 @@ |
| 95 | </dependency> | 95 | </dependency> |
| 96 | <dependency> | 96 | <dependency> |
| 97 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> | 97 | <groupId>org.glassfish.jersey.test-framework.providers</groupId> |
| 98 | - <artifactId>jersey-test-framework-provider-grizzly2</artifactId> | 98 | + <artifactId>jersey-test-framework-provider-jetty</artifactId> |
| 99 | <scope>test</scope> | 99 | <scope>test</scope> |
| 100 | </dependency> | 100 | </dependency> |
| 101 | 101 | ... | ... |
-
Please register or login to post a comment