Merge pull request #3224 from mhajas/KEYCLOAK-3551
KEYCLOAK-3551 Remove example-dist dependency from testsuite
This commit is contained in:
commit
b32b222b02
4 changed files with 63 additions and 27 deletions
|
@ -17,11 +17,6 @@
|
|||
|
||||
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.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
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.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author tkyjovsk
|
||||
|
@ -50,11 +50,11 @@ public abstract class AbstractExampleAdapterTest extends AbstractAdapterTest {
|
|||
Assert.assertNotNull("Property ${examples.version.suffix} must bet set.", EXAMPLES_VERSION_SUFFIX);
|
||||
System.out.println(EXAMPLES_VERSION_SUFFIX);
|
||||
|
||||
EXAMPLES_HOME_DIR = EXAMPLES_HOME + "/example-realms";
|
||||
|
||||
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";
|
||||
} else {
|
||||
EXAMPLES_HOME_DIR = EXAMPLES_HOME + "/keycloak-examples-" + EXAMPLES_VERSION_SUFFIX;
|
||||
TEST_APPS_HOME_DIR = EXAMPLES_HOME + "/Keycloak-" + EXAMPLES_VERSION_SUFFIX + "-test-apps";
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public abstract class AbstractDemoExampleAdapterTest extends AbstractExampleAdap
|
|||
@Override
|
||||
public void addAdapterTestRealms(List<RealmRepresentation> testRealms) {
|
||||
testRealms.add(
|
||||
loadRealm(new File(EXAMPLES_HOME_DIR + "/preconfigured-demo/testrealm.json")));
|
||||
loadRealm(new File(EXAMPLES_HOME_DIR + "/demo-template/testrealm.json")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,22 +17,23 @@
|
|||
|
||||
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 static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
import org.keycloak.testsuite.auth.page.account.Account;
|
||||
import static org.keycloak.testsuite.util.IOUtil.loadRealm;
|
||||
import static org.keycloak.testsuite.adapter.AbstractExampleAdapterTest.EXAMPLES_HOME_DIR;
|
||||
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
|
||||
import org.keycloak.testsuite.adapter.page.fuse.AdminInterface;
|
||||
import org.keycloak.testsuite.adapter.page.fuse.CustomerListing;
|
||||
import org.keycloak.testsuite.adapter.page.fuse.CustomerPortalFuseExample;
|
||||
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.util.IOUtil.loadRealm;
|
||||
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
|
||||
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;
|
||||
import static org.keycloak.testsuite.util.WaitUtils.pause;
|
||||
|
|
|
@ -67,7 +67,8 @@
|
|||
|
||||
<app.server.home>${containers.home}/app-server-${app.server}</app.server.home>
|
||||
<adapter.config.bundled>true</adapter.config.bundled>
|
||||
|
||||
<examples.basedir>${main.basedir}/examples</examples.basedir>
|
||||
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
@ -87,6 +88,23 @@
|
|||
</activation>
|
||||
<build>
|
||||
<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>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
|
@ -311,20 +329,13 @@
|
|||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>example-realms</id>
|
||||
<id>test-apps-realms</id>
|
||||
<phase>generate-test-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<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>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<artifactId>integration-arquillian-test-apps-dist</artifactId>
|
||||
|
@ -336,9 +347,33 @@
|
|||
<outputDirectory>${examples.home}</outputDirectory>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</execution>
|
||||
</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>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
|
|
Loading…
Reference in a new issue