Merge pull request #3224 from mhajas/KEYCLOAK-3551

KEYCLOAK-3551 Remove example-dist dependency from testsuite
This commit is contained in:
Stian Thorgersen 2016-09-16 09:46:42 +02:00 committed by GitHub
commit b32b222b02
4 changed files with 63 additions and 27 deletions

View file

@ -17,11 +17,6 @@
package org.keycloak.testsuite.adapter; package org.keycloak.testsuite.adapter;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Paths;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.asset.StringAsset;
@ -29,6 +24,11 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive; import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert; import org.junit.Assert;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Paths;
/** /**
* *
* @author tkyjovsk * @author tkyjovsk
@ -50,11 +50,11 @@ public abstract class AbstractExampleAdapterTest extends AbstractAdapterTest {
Assert.assertNotNull("Property ${examples.version.suffix} must bet set.", EXAMPLES_VERSION_SUFFIX); Assert.assertNotNull("Property ${examples.version.suffix} must bet set.", EXAMPLES_VERSION_SUFFIX);
System.out.println(EXAMPLES_VERSION_SUFFIX); System.out.println(EXAMPLES_VERSION_SUFFIX);
EXAMPLES_HOME_DIR = EXAMPLES_HOME + "/example-realms";
if (!System.getProperty("unpacked.container.folder.name","").isEmpty()) { if (!System.getProperty("unpacked.container.folder.name","").isEmpty()) {
EXAMPLES_HOME_DIR = EXAMPLES_HOME + "/" + System.getProperty("unpacked.container.folder.name","") + "-examples";
TEST_APPS_HOME_DIR = EXAMPLES_HOME + "/" + System.getProperty("unpacked.container.folder.name","") + "-test-apps"; TEST_APPS_HOME_DIR = EXAMPLES_HOME + "/" + System.getProperty("unpacked.container.folder.name","") + "-test-apps";
} else { } else {
EXAMPLES_HOME_DIR = EXAMPLES_HOME + "/keycloak-examples-" + EXAMPLES_VERSION_SUFFIX;
TEST_APPS_HOME_DIR = EXAMPLES_HOME + "/Keycloak-" + EXAMPLES_VERSION_SUFFIX + "-test-apps"; TEST_APPS_HOME_DIR = EXAMPLES_HOME + "/Keycloak-" + EXAMPLES_VERSION_SUFFIX + "-test-apps";
} }

View file

@ -98,7 +98,7 @@ public abstract class AbstractDemoExampleAdapterTest extends AbstractExampleAdap
@Override @Override
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) { public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
testRealms.add( testRealms.add(
loadRealm(new File(EXAMPLES_HOME_DIR + "/preconfigured-demo/testrealm.json"))); loadRealm(new File(EXAMPLES_HOME_DIR + "/demo-template/testrealm.json")));
} }
@Override @Override

View file

@ -17,22 +17,23 @@
package org.keycloak.testsuite.adapter.example; package org.keycloak.testsuite.adapter.example;
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
import java.io.File;
import java.util.List;
import org.jboss.arquillian.graphene.page.Page; import org.jboss.arquillian.graphene.page.Page;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test; import org.junit.Test;
import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.testsuite.auth.page.account.Account; import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
import static org.keycloak.testsuite.adapter.AbstractExampleAdapterTest.EXAMPLES_HOME_DIR;
import org.keycloak.testsuite.adapter.page.fuse.AdminInterface; import org.keycloak.testsuite.adapter.page.fuse.AdminInterface;
import org.keycloak.testsuite.adapter.page.fuse.CustomerListing; import org.keycloak.testsuite.adapter.page.fuse.CustomerListing;
import org.keycloak.testsuite.adapter.page.fuse.CustomerPortalFuseExample; import org.keycloak.testsuite.adapter.page.fuse.CustomerPortalFuseExample;
import org.keycloak.testsuite.adapter.page.fuse.ProductPortalFuseExample; import org.keycloak.testsuite.adapter.page.fuse.ProductPortalFuseExample;
import org.keycloak.testsuite.auth.page.account.Account;
import java.io.File;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO; import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf; import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;
import static org.keycloak.testsuite.util.WaitUtils.pause; import static org.keycloak.testsuite.util.WaitUtils.pause;

View file

@ -67,7 +67,8 @@
<app.server.home>${containers.home}/app-server-${app.server}</app.server.home> <app.server.home>${containers.home}/app-server-${app.server}</app.server.home>
<adapter.config.bundled>true</adapter.config.bundled> <adapter.config.bundled>true</adapter.config.bundled>
<examples.basedir>${main.basedir}/examples</examples.basedir>
</properties> </properties>
<modules> <modules>
@ -87,6 +88,23 @@
</activation> </activation>
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId>
<version>0.1</version>
<executions>
<execution>
<id>directories</id>
<goals>
<goal>highest-basedir</goal>
</goals>
<phase>initialize</phase>
<configuration>
<property>main.basedir</property>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId> <artifactId>xml-maven-plugin</artifactId>
@ -311,20 +329,13 @@
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
<id>example-realms</id> <id>test-apps-realms</id>
<phase>generate-test-resources</phase> <phase>generate-test-resources</phase>
<goals> <goals>
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
<configuration> <configuration>
<artifactItems> <artifactItems>
<artifactItem>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-examples-dist</artifactId>
<version>${project.version}</version>
<type>zip</type>
<includes>**/*realm.json,**/testsaml.json</includes>
</artifactItem>
<artifactItem> <artifactItem>
<groupId>org.keycloak.testsuite</groupId> <groupId>org.keycloak.testsuite</groupId>
<artifactId>integration-arquillian-test-apps-dist</artifactId> <artifactId>integration-arquillian-test-apps-dist</artifactId>
@ -336,9 +347,33 @@
<outputDirectory>${examples.home}</outputDirectory> <outputDirectory>${examples.home}</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer> <overWriteIfNewer>true</overWriteIfNewer>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>example-realms</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${examples.home}/example-realms</outputDirectory>
<overWriteIfNewer>true</overWriteIfNewer>
<resources>
<resource>
<directory>${examples.basedir}</directory>
<filtering>true</filtering>
<includes>**/*realm.json,**/testsaml.json</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<configuration> <configuration>