Merge pull request #2734 from vramik/KEYCLOAK-2889

KEYCLOAK-2889 Fix adapter tests for Karaf/Fuse
This commit is contained in:
Stian Thorgersen 2016-04-27 13:49:27 +02:00
commit d77c1e616f
9 changed files with 63 additions and 5 deletions

View file

@ -28,6 +28,10 @@ if "%UNINSTALL_PAX%" == "true" (
call client.bat %CLIENT_AUTH% -f uninstall-pax.cli
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
)
if "%UPDATE_CONFIG%" == "true" (
call client.bat %CLIENT_AUTH% -f update-config.cli
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
)
call client.bat %CLIENT_AUTH% -f install-features.cli
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%

View file

@ -22,6 +22,16 @@ do
if [ $? -ne 0 ]; then RESULT=1; fi
fi
if "$UPDATE_CONFIG" == "true"; then
echo "Updating Config - org.ops4j.pax.url.mvn"
./client $CLIENT_AUTH -f update-config.cli
if [ $? -ne 0 ]; then
RESULT=1;
else
./client $CLIENT_AUTH config:list | grep org.ops4j.pax.url.mvn.
fi
fi
echo "Installing features."
./client $CLIENT_AUTH -f install-features.cli
if [ $? -ne 0 ]; then RESULT=1; fi

View file

@ -0,0 +1,5 @@
config:edit org.ops4j.pax.url.mvn
config:propset org.ops4j.pax.url.mvn.localRepository ${maven.repo.local}
config:propset org.ops4j.pax.url.mvn.settings ${maven.local.settings}
config:propappend org.ops4j.pax.url.mvn.repositories ${repositories}
config:update

View file

@ -0,0 +1,5 @@
config:edit org.ops4j.pax.url.mvn
config:property-set org.ops4j.pax.url.mvn.localRepository ${maven.repo.local}
config:property-set org.ops4j.pax.url.mvn.settings ${maven.local.settings}
config:property-append org.ops4j.pax.url.mvn.repositories ${repositories}
config:update

View file

@ -35,6 +35,7 @@
<app.server.karaf.home>${containers.home}/${app.server.karaf.unpacked.folder.name}</app.server.karaf.home>
<app.server.karaf.client.auth>-u karaf</app.server.karaf.client.auth>
<app.server.karaf.uninstall.pax>false</app.server.karaf.uninstall.pax>
<app.server.karaf.update.config>false</app.server.karaf.update.config>
</properties>
<profiles>
@ -103,7 +104,7 @@
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-features-clie</id>
<id>copy-clis</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
@ -115,6 +116,7 @@
<directory>src/main/resources</directory>
<includes>
<include>install-features.cli</include>
<include>update-config.cli</include>
</includes>
<filtering>true</filtering>
</resource>
@ -161,6 +163,7 @@
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
<CLIENT_AUTH>${app.server.karaf.client.auth}</CLIENT_AUTH>
<UNINSTALL_PAX>${app.server.karaf.uninstall.pax}</UNINSTALL_PAX>
<UPDATE_CONFIG>${app.server.karaf.update.config}</UPDATE_CONFIG>
</environmentVariables>
</configuration>
</plugin>

View file

@ -38,7 +38,6 @@
<eap.version>7.0.0.ER6-redhat-1</eap.version>
<eap6.version>7.5.6.Final-redhat-2</eap6.version>
<jboss.as.version>7.1.1.Final</jboss.as.version>
<eap6.version>7.5.6.Final-redhat-2</eap6.version>
<tomcat7.version>7.0.68</tomcat7.version>
<tomcat8.version>8.0.32</tomcat8.version>
<tomcat9.version>9.0.0.M3</tomcat9.version>

View file

@ -43,4 +43,19 @@ public abstract class AbstractFuseExample extends AppServerContextRoot {
return url;
}
/*
* non-javadoc
*
* When run tests with phantomjs customer or prutuct portal page isn't properly
* loaded. This method reloads page in such case.
*/
@Override
public void navigateTo() {
super.navigateTo();
if (driver.getPageSource().contains("<html><head></head><body></body></html>")) {
log.debug("Page wasn't properly loaded - redirecting.");
super.navigateTo();
}
}
}

View file

@ -58,8 +58,8 @@ public abstract class AbstractFuseExampleAdapterTest extends AbstractExampleAdap
@Override
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
RealmRepresentation fureRealm = loadRealm(new File(EXAMPLES_HOME_DIR + "/fuse/testrealm.json"));
testRealms.add(fureRealm);
RealmRepresentation fuseRealm = loadRealm(new File(EXAMPLES_HOME_DIR + "/fuse/testrealm.json"));
testRealms.add(fuseRealm);
}
@Override
@ -121,6 +121,7 @@ public abstract class AbstractFuseExampleAdapterTest extends AbstractExampleAdap
pause(500);
assertCurrentUrlStartsWith(customerPortal);
customerPortal.navigateTo();//needed for phantomjs
customerPortal.clickAdminInterfaceLink();
assertCurrentUrlStartsWithLoginUrlOf(testRealmPage);

View file

@ -1,3 +1,19 @@
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.keycloak.testsuite.adapter.example;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;