KEYCLOAK-7091 fuse7 testsuite

This commit is contained in:
vramik 2018-04-11 11:45:56 +02:00 committed by Hynek Mlnařík
parent 634e7170e3
commit 8b5fd2b4ac
20 changed files with 296 additions and 66 deletions

View file

@ -47,6 +47,7 @@
<arquillian-graphene.version>2.3.1</arquillian-graphene.version>
<arquillian-wildfly-container.version>2.1.0.Final</arquillian-wildfly-container.version>
<arquillian-wls-container.version>1.0.1.Final</arquillian-wls-container.version>
<arquillian-container-karaf.version>2.2.0.Final</arquillian-container-karaf.version>
<arquillian-infinispan-container.version>1.2.0.Beta2</arquillian-infinispan-container.version>
<version.shrinkwrap.resolvers>2.2.6</version.shrinkwrap.resolvers>
<undertow-embedded.version>1.0.0.Alpha2</undertow-embedded.version>

View file

@ -58,6 +58,6 @@
</executions>
</plugin>
</plugins>
</build>
</build>
</project>

View file

@ -0,0 +1,63 @@
<?xml version="1.0"?>
<!--
~ 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.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<parent>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-servers-app-server-karaf</artifactId>
<version>4.0.0.Beta2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>integration-arquillian-servers-app-server-fuse70</artifactId>
<packaging>pom</packaging>
<name>App Server - Karaf - JBoss Fuse 7.0</name>
<properties>
<app.server.karaf>fuse70</app.server.karaf>
<app.server.karaf.groupId>org.jboss.fuse</app.server.karaf.groupId>
<app.server.karaf.artifactId>jboss-fuse-karaf</app.server.karaf.artifactId>
<app.server.karaf.version>${fuse70.version}</app.server.karaf.version>
<app.server.karaf.unpacked.folder.name>jboss-fuse-karaf-${fuse70.version}</app.server.karaf.unpacked.folder.name>
<app.server.karaf.client.auth>-u admin -p admin</app.server.karaf.client.auth>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>fuse70.version</property>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,3 @@
feature:repo-add mvn:org.keycloak/keycloak-osgi-features/${project.version}/xml/features
feature:repo-add mvn:org.keycloak.example.demo/keycloak-fuse-example-features/${project.version}/xml/features
feature:install keycloak-fuse-7.0-example

View file

@ -0,0 +1,9 @@
{
"realm": "demo",
"resource": "ssh-jmx-admin-client",
"ssl-required" : "external",
"auth-server-url" : "http://localhost:8080/auth",
"credentials": {
"secret": "password"
}
}

View file

@ -0,0 +1,7 @@
{
"realm" : "demo",
"resource" : "hawtio-client",
"auth-server-url" : "http://localhost:8080/auth",
"ssl-required" : "external",
"public-client" : true
}

View file

@ -0,0 +1,9 @@
{
"realm" : "demo",
"resource" : "jaas",
"bearer-only" : true,
"auth-server-url" : "http://localhost:8080/auth",
"ssl-required" : "external",
"use-resource-role-mappings": false,
"principal-attribute": "preferred_username"
}

View file

@ -0,0 +1,8 @@
config:edit org.apache.karaf.shell
config:property-set sshRealm keycloak
config:update
system:property -p hawtio.roles admin,user
system:property -p hawtio.keycloakEnabled true
system:property -p hawtio.realm keycloak
system:property -p hawtio.keycloakClientConfig file://\$\{karaf.base\}/etc/keycloak-hawtio-client.json
system:property -p hawtio.rolePrincipalClasses org.keycloak.adapters.jaas.RolePrincipal,org.apache.karaf.jaas.boot.principal.RolePrincipal

View file

@ -0,0 +1,10 @@
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
config:edit jmx.acl.org.apache.karaf.security.jmx
config:property-append list* viewer
config:property-append set* jmxAdmin
config:property-append * jmxAdmin,admin
config:update

View file

@ -0,0 +1 @@
admin=admin,admin,manager,viewer,ssh,systembundles

View file

@ -192,32 +192,78 @@
</plugins>
</build>
</profile>
<profile>
<id>enforce-props-when-update-config</id>
<activation>
<property>
<name>app.server.karaf.update.config</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-props-when-update-config</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<message>When updating config maven.local.settings is expected to be explicitly set.</message>
<property>maven.local.settings</property>
</requireProperty>
<requireProperty>
<message>When updating config maven.repo.local is expected to be explicitly set.</message>
<property>maven.repo.local</property>
</requireProperty>
<requireProperty>
<message>When updating config repositories is expected to be set.</message>
<property>repositories</property>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>app-server-karaf3</id>
<modules>
<module>karaf3</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse61</id>
<modules>
<module>fuse61</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse62</id>
<modules>
<module>fuse62</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse63</id>
<modules>
<module>fuse63</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse70</id>
<modules>
<module>fuse70</module>
</modules>
</profile>
</profiles>
</project>

View file

@ -1,7 +1,6 @@
package org.keycloak.testsuite.arquillian.karaf;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@ -25,7 +24,7 @@ import org.slf4j.LoggerFactory;
/**
* KarafManagedDeployableContainer
*
*
* @author thomas.diesler@jboss.com
*/
public class CustomKarafContainer<T extends KarafManagedContainerConfiguration> extends JMXDeployableContainer<T> {
@ -79,7 +78,7 @@ public class CustomKarafContainer<T extends KarafManagedContainerConfiguration>
String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
_logger.info(String.format("Using java: %s", java));
List<String> cmd = new ArrayList<String>();
List<String> cmd = new ArrayList<>();
cmd.add(java);
// JavaVM args
@ -95,6 +94,7 @@ public class CustomKarafContainer<T extends KarafManagedContainerConfiguration>
cmd.add("-Dkaraf.etc=" + karafHomeDir + "/etc");
cmd.add("-Dkaraf.data=" + karafHomeDir + "/data");
cmd.add("-Dkaraf.instances=" + karafHomeDir + "/instances");
cmd.add("-Dkaraf.restart.jvm.supported=true");
cmd.add("-Dkaraf.startLocalConsole=false");
cmd.add("-Dkaraf.startRemoteShell=true");
@ -105,16 +105,23 @@ public class CustomKarafContainer<T extends KarafManagedContainerConfiguration>
// Classpath
StringBuilder classPath = new StringBuilder();
File karafLibDir = new File(karafHomeDir, "lib");
String[] libs = karafLibDir.list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.startsWith("karaf");
boolean fuse7 = new File(karafHomeDir, "lib/boot/").exists();
if (fuse7) {
_logger.info("Adding karaf4 libraries to classpath.");
File karafLibBootDir = new File(karafHomeDir, "lib/boot/");
String[] libs = karafLibBootDir.list((File dir, String name) -> name.endsWith(".jar"));
for (String lib : libs) {
String separator = classPath.length() > 0 ? File.pathSeparator : "";
classPath.append(separator).append(new File(karafLibBootDir, lib));
}
} else { //fuse6
_logger.info("Adding karaf3 libraries to classpath.");
File karafLibDir = new File(karafHomeDir, "lib");
String[] libs = karafLibDir.list((File dir, String name) -> name.startsWith("karaf"));
for (String lib : libs) {
String separator = classPath.length() > 0 ? File.pathSeparator : "";
classPath.append(separator).append(new File(karafHomeDir, "lib/" + lib));
}
});
for (String lib : libs) {
String separator = classPath.length() > 0 ? File.pathSeparator : "";
classPath.append(separator).append(new File(karafHomeDir, "lib/" + lib));
}
cmd.add("-classpath");
cmd.add(classPath.toString());
@ -194,7 +201,7 @@ public class CustomKarafContainer<T extends KarafManagedContainerConfiguration>
private void destroyKarafProcess() throws LifecycleException {
if (process != null) {
process.destroy();
process.destroy();
try {
process.waitFor();
} catch (InterruptedException e) {

View file

@ -42,7 +42,6 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${apache.httpcomponents.version}</version>
</dependency>
</dependencies>

View file

@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!--
~ 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.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-tests-adapters-karaf</artifactId>
<version>4.0.0.Beta2-SNAPSHOT</version>
</parent>
<artifactId>integration-arquillian-tests-adapters-fuse70</artifactId>
<name>Adapter Tests - Karaf - JBoss Fuse 7.0</name>
<properties>
<app.server>fuse70</app.server>
<app.server.management.user>admin</app.server.management.user>
<app.server.management.password>admin</app.server.management.password>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,25 @@
/*
* 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;
@AppServerContainer("app-server-fuse70")
public class Fuse70AdminAdapterTest extends AbstractFuseAdminAdapterTest {
}

View file

@ -0,0 +1,25 @@
/*
* 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;
@AppServerContainer("app-server-fuse70")
public class Fuse70ExampleAdapterTest extends AbstractFuseExampleAdapterTest {
}

View file

@ -53,41 +53,6 @@
<exists>src</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-karaf-managed</artifactId>
<version>2.1.0.CR18</version>
</dependency>
<dependency>
<groupId>org.apache.aries.jmx</groupId>
<artifactId>org.apache.aries.jmx</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.12</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<artifactId>org.apache.karaf.shell.console</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.karaf</groupId>
<artifactId>org.apache.karaf.client</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -113,33 +78,37 @@
</build>
</profile>
<profile>
<id>app-server-karaf3</id>
<modules>
<module>karaf3</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse61</id>
<modules>
<module>fuse61</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse62</id>
<modules>
<module>fuse62</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse63</id>
<modules>
<module>fuse63</module>
</modules>
</profile>
</profile>
<profile>
<id>app-server-fuse70</id>
<modules>
<module>fuse70</module>
</modules>
</profile>
</profiles>
</project>

View file

@ -347,12 +347,12 @@
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-karaf-managed</artifactId>
<version>2.1.0.CR18</version>
<version>${arquillian-container-karaf.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-osgi</artifactId>
<version>2.1.0.CR18</version>
<version>${arquillian-container-karaf.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>