keycloak-memoizeit

KEYCLOAK-8699 replace hostnames with nip.io ones to include

3/1/2019 8:49:21 AM

Details

diff --git a/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/js/app.js b/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/js/app.js
index 9b8424c..6ee2ea1 100755
--- a/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/js/app.js
+++ b/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/js/app.js
@@ -18,7 +18,7 @@
 var module = angular.module('product', []);
 
 function getAuthServerUrl() {
-    var url = 'https://localhost-auth:8543';
+    var url = 'https://localhost-auth-127.0.0.1.nip.io:8543';
 
     return url;
 }
@@ -69,7 +69,7 @@ module.controller('GlobalCtrl', function($scope, $http) {
     $scope.realm = [];
     $scope.version = [];
     $scope.reloadData = function() {
-        $http.get(getAppServerUrl("localhost-db") + "/cors-database/products").success(function(data, status, headers, config) {
+        $http.get(getAppServerUrl("localhost-db-127.0.0.1.nip.io") + "/cors-database/products").success(function(data, status, headers, config) {
             $scope.products = angular.fromJson(data);
             $scope.headers = headers();
         });
@@ -109,7 +109,7 @@ module.controller('GlobalCtrl', function($scope, $http) {
     };
 
     $scope.loadVersion = function() {
-        $http.get(getAppServerUrl("localhost-db") + "/cors-database/products/k_version").success(function(data) {
+        $http.get(getAppServerUrl("localhost-db-127.0.0.1.nip.io") + "/cors-database/products/k_version").success(function(data) {
             $scope.version = angular.fromJson(data);
         });
     };
diff --git a/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/keycloak.json b/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/keycloak.json
index ee2f3a7..4f1d9a1 100755
--- a/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/keycloak.json
+++ b/testsuite/integration-arquillian/test-apps/cors/angular-product/src/main/webapp/keycloak.json
@@ -1,7 +1,7 @@
 {
   "realm" : "cors",
   "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
-  "auth-server-url" : "http://localhost-auth:8180/auth",
+  "auth-server-url" : "http://localhost-auth-127.0.0.1.nip.io:8180/auth",
   "ssl-required" : "external",
   "disable-trust-manager" : "true",
   "resource" : "angular-cors-product",
diff --git a/testsuite/integration-arquillian/test-apps/cors/database-service/src/main/webapp/WEB-INF/keycloak.json b/testsuite/integration-arquillian/test-apps/cors/database-service/src/main/webapp/WEB-INF/keycloak.json
index 1b4d3dd..8686d18 100755
--- a/testsuite/integration-arquillian/test-apps/cors/database-service/src/main/webapp/WEB-INF/keycloak.json
+++ b/testsuite/integration-arquillian/test-apps/cors/database-service/src/main/webapp/WEB-INF/keycloak.json
@@ -2,7 +2,7 @@
   "realm" : "cors",
   "resource" : "cors-database-service",
   "realm-public-key" : "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB",
-  "auth-server-url": "http://localhost-auth:8180/auth",
+  "auth-server-url": "http://localhost-auth-127.0.0.1.nip.io:8180/auth",
   "bearer-only" : true,
   "ssl-required": "external",
   "disable-trust-manager" : "true",
diff --git a/testsuite/integration-arquillian/tests/base/pom.xml b/testsuite/integration-arquillian/tests/base/pom.xml
index 84f0a67..9a81ea5 100644
--- a/testsuite/integration-arquillian/tests/base/pom.xml
+++ b/testsuite/integration-arquillian/tests/base/pom.xml
@@ -45,8 +45,6 @@
         <exclude.x509>**/x509/*Test.java</exclude.x509>
         <!-- KEYCLOAK-6771 exclude Mutual TLS Holder of Key Token x509 tests by default, enabled by 'ssl' profile -->
         <exclude.HoK>**/hok/**/*Test.java</exclude.HoK>
-        <!-- see include-CORS-tests profile -->
-        <exclude.cors.tests>**/cors/*Test.java</exclude.cors.tests>
     </properties>
     
     <dependencies>
@@ -188,7 +186,6 @@
                         <exclude>${exclude.cluster}</exclude>
                         <exclude>${exclude.crossdc}</exclude>
                         <exclude>${exclude.x509}</exclude>
-                        <exclude>${exclude.cors.tests}</exclude>
                         <exclude>${exclude.HoK}</exclude>
                     </excludes>
                     <systemPropertyVariables>
@@ -749,25 +746,6 @@
                 <surefire.memory.settings>-Xms512m -Xmx1024m -XX:MetaspaceSize=96m -XX:MaxMetaspaceSize=256m</surefire.memory.settings>
             </properties>
         </profile>
-        <profile>
-            <id>include-CORS-tests</id>
-            <!--
-            If you want to run CORS tests it is necessary to put
-
-            127.0.0.1 localhost-auth
-            127.0.0.1 localhost-db
-
-            to your /etc/hosts file
-            -->
-            <activation>
-                <property>
-                    <name>includeCorsTests</name>
-                </property>
-            </activation>
-            <properties>
-                <exclude.cors.tests>-</exclude.cors.tests>
-            </properties>
-        </profile>
     </profiles>
 
 </project>
diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java
index 926ae06..e107f79 100644
--- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java
+++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/adapter/example/cors/CorsExampleAdapterTest.java
@@ -49,13 +49,14 @@ import java.util.regex.Pattern;
 
 import static junit.framework.TestCase.assertNotNull;
 import org.junit.Assume;
+import org.keycloak.testsuite.util.DroneUtils;
 import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm;
 import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
 import static org.keycloak.testsuite.util.WaitUtils.waitForPageToLoad;
 import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
 
 /**
- * Tests CORS fuctionality in adapters.
+ * Tests CORS functionality in adapters.
  *
  * <p>
  *    Note, for SSL this test disables TLS certificate verification. Since CORS uses different hostnames
@@ -72,7 +73,7 @@ import static org.keycloak.testsuite.util.WaitUtils.waitUntilElement;
 public class CorsExampleAdapterTest extends AbstractExampleAdapterTest {
 
     public static final String CORS = "cors";
-    public static final String AUTH_SERVER_HOST = "localhost-auth";
+    public static final String AUTH_SERVER_HOST = "localhost-auth-127.0.0.1.nip.io";
     private static final String hostBackup;
 
     @ArquillianResource
@@ -113,6 +114,7 @@ public class CorsExampleAdapterTest extends AbstractExampleAdapterTest {
 
     @Before
     public void onBefore() {
+        DroneUtils.addWebDriver(jsDriver);
         Assume.assumeFalse(System.getProperty("os.name").startsWith("Windows"));
         deployer.deploy(CorsDatabaseServiceTestApp.DEPLOYMENT_NAME);
         deployer.deploy(AngularCorsProductTestApp.DEPLOYMENT_NAME);
@@ -182,14 +184,14 @@ public class CorsExampleAdapterTest extends AbstractExampleAdapterTest {
 
     @Nullable
     private String getAuthServerVersion() {
-        jsDriver.navigate().to(suiteContext.getAuthServerInfo().getContextRoot().toString() +
+        DroneUtils.getCurrentDriver().navigate().to(suiteContext.getAuthServerInfo().getContextRoot().toString() +
                 "/auth/admin/master/console/#/server-info");
         jsDriverTestRealmLoginPage.form().login("admin", "admin");
 
         WaitUtils.waitUntilElement(By.tagName("body")).is().visible();
         Pattern pattern = Pattern.compile("<td [^>]+>Server Version</td>" +
                 "\\s+<td [^>]+>([^<]+)</td>");
-        Matcher matcher = pattern.matcher(jsDriver.getPageSource());
+        Matcher matcher = pattern.matcher(DroneUtils.getCurrentDriver().getPageSource());
 
         if (matcher.find()) {
             return matcher.group(1);
diff --git a/testsuite/integration-arquillian/tests/other/adapters/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/pom.xml
index f93b803..e6a2b38 100644
--- a/testsuite/integration-arquillian/tests/other/adapters/pom.xml
+++ b/testsuite/integration-arquillian/tests/other/adapters/pom.xml
@@ -95,7 +95,6 @@
         <adapter.config.bundled>true</adapter.config.bundled>
         <examples.basedir>${keycloak-parent.basedir}/examples</examples.basedir>
         <exclude.test>-</exclude.test>
-        <exclude.cors.tests>**/cors/*Test.java</exclude.cors.tests>
     </properties>
 
     <modules>
@@ -399,25 +398,6 @@
                 </pluginManagement>
             </build>
         </profile>
-        <profile>
-            <id>Include CORS tests</id>
-            <!--
-            If you want to run CORS tests it is necessary to put
-
-            127.0.0.1 localhost-auth
-            127.0.0.1 localhost-db
-
-            to your /etc/hosts file
-            -->
-            <activation>
-                <property>
-                    <name>includeCorsTests</name>
-                </property>
-            </activation>
-            <properties>
-                <exclude.cors.tests>-</exclude.cors.tests>
-            </properties>
-        </profile>
     </profiles>
 
 </project>