Merge pull request #2734 from vramik/KEYCLOAK-2889
KEYCLOAK-2889 Fix adapter tests for Karaf/Fuse
This commit is contained in:
commit
d77c1e616f
9 changed files with 63 additions and 5 deletions
|
@ -28,6 +28,10 @@ if "%UNINSTALL_PAX%" == "true" (
|
||||||
call client.bat %CLIENT_AUTH% -f uninstall-pax.cli
|
call client.bat %CLIENT_AUTH% -f uninstall-pax.cli
|
||||||
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
|
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
|
call client.bat %CLIENT_AUTH% -f install-features.cli
|
||||||
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
|
if %ERRORLEVEL% neq 0 set ERROR=%ERRORLEVEL%
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,16 @@ do
|
||||||
if [ $? -ne 0 ]; then RESULT=1; fi
|
if [ $? -ne 0 ]; then RESULT=1; fi
|
||||||
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."
|
echo "Installing features."
|
||||||
./client $CLIENT_AUTH -f install-features.cli
|
./client $CLIENT_AUTH -f install-features.cli
|
||||||
if [ $? -ne 0 ]; then RESULT=1; fi
|
if [ $? -ne 0 ]; then RESULT=1; fi
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -35,6 +35,7 @@
|
||||||
<app.server.karaf.home>${containers.home}/${app.server.karaf.unpacked.folder.name}</app.server.karaf.home>
|
<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.client.auth>-u karaf</app.server.karaf.client.auth>
|
||||||
<app.server.karaf.uninstall.pax>false</app.server.karaf.uninstall.pax>
|
<app.server.karaf.uninstall.pax>false</app.server.karaf.uninstall.pax>
|
||||||
|
<app.server.karaf.update.config>false</app.server.karaf.update.config>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -103,7 +104,7 @@
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>copy-features-clie</id>
|
<id>copy-clis</id>
|
||||||
<phase>process-resources</phase>
|
<phase>process-resources</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>copy-resources</goal>
|
<goal>copy-resources</goal>
|
||||||
|
@ -115,6 +116,7 @@
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>install-features.cli</include>
|
<include>install-features.cli</include>
|
||||||
|
<include>update-config.cli</include>
|
||||||
</includes>
|
</includes>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
|
@ -161,6 +163,7 @@
|
||||||
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
|
<JAVA_HOME>${app.server.java.home}</JAVA_HOME>
|
||||||
<CLIENT_AUTH>${app.server.karaf.client.auth}</CLIENT_AUTH>
|
<CLIENT_AUTH>${app.server.karaf.client.auth}</CLIENT_AUTH>
|
||||||
<UNINSTALL_PAX>${app.server.karaf.uninstall.pax}</UNINSTALL_PAX>
|
<UNINSTALL_PAX>${app.server.karaf.uninstall.pax}</UNINSTALL_PAX>
|
||||||
|
<UPDATE_CONFIG>${app.server.karaf.update.config}</UPDATE_CONFIG>
|
||||||
</environmentVariables>
|
</environmentVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
<eap.version>7.0.0.ER6-redhat-1</eap.version>
|
<eap.version>7.0.0.ER6-redhat-1</eap.version>
|
||||||
<eap6.version>7.5.6.Final-redhat-2</eap6.version>
|
<eap6.version>7.5.6.Final-redhat-2</eap6.version>
|
||||||
<jboss.as.version>7.1.1.Final</jboss.as.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>
|
<tomcat7.version>7.0.68</tomcat7.version>
|
||||||
<tomcat8.version>8.0.32</tomcat8.version>
|
<tomcat8.version>8.0.32</tomcat8.version>
|
||||||
<tomcat9.version>9.0.0.M3</tomcat9.version>
|
<tomcat9.version>9.0.0.M3</tomcat9.version>
|
||||||
|
|
|
@ -42,5 +42,20 @@ public abstract class AbstractFuseExample extends AppServerContextRoot {
|
||||||
}
|
}
|
||||||
return url;
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,8 @@ public abstract class AbstractFuseExampleAdapterTest extends AbstractExampleAdap
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
|
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
|
||||||
RealmRepresentation fureRealm = loadRealm(new File(EXAMPLES_HOME_DIR + "/fuse/testrealm.json"));
|
RealmRepresentation fuseRealm = loadRealm(new File(EXAMPLES_HOME_DIR + "/fuse/testrealm.json"));
|
||||||
testRealms.add(fureRealm);
|
testRealms.add(fuseRealm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -121,6 +121,7 @@ public abstract class AbstractFuseExampleAdapterTest extends AbstractExampleAdap
|
||||||
pause(500);
|
pause(500);
|
||||||
assertCurrentUrlStartsWith(customerPortal);
|
assertCurrentUrlStartsWith(customerPortal);
|
||||||
|
|
||||||
|
customerPortal.navigateTo();//needed for phantomjs
|
||||||
customerPortal.clickAdminInterfaceLink();
|
customerPortal.clickAdminInterfaceLink();
|
||||||
assertCurrentUrlStartsWithLoginUrlOf(testRealmPage);
|
assertCurrentUrlStartsWithLoginUrlOf(testRealmPage);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package org.keycloak.testsuite.adapter.example;
|
||||||
|
|
||||||
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
|
||||||
|
|
Loading…
Reference in a new issue