KEYCLOAK-5678 Extend server-config-migration tests to test also extensions and management

This commit is contained in:
vramik 2017-11-07 12:46:13 +01:00
parent ffc0d7fc7c
commit 819181007c
7 changed files with 107 additions and 2 deletions

View file

@ -209,6 +209,51 @@
<outputFile>${project.build.directory}/master-standalone-ha.txt</outputFile> <outputFile>${project.build.directory}/master-standalone-ha.txt</outputFile>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>read-master-domain-core-service</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.sh</executable>
<workingDirectory>${jbossHome}/bin</workingDirectory>
<arguments>
<argument>--file=${project.build.directory}/classes/cli/read-domain-core-service.cli</argument>
</arguments>
<outputFile>${project.build.directory}/master-domain-core-service.txt</outputFile>
</configuration>
</execution>
<execution>
<id>read-master-domain-extension</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.sh</executable>
<workingDirectory>${jbossHome}/bin</workingDirectory>
<arguments>
<argument>--file=${project.build.directory}/classes/cli/read-domain-extension.cli</argument>
</arguments>
<outputFile>${project.build.directory}/master-domain-extension.txt</outputFile>
</configuration>
</execution>
<execution>
<id>read-master-domain-interface</id>
<phase>process-classes</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.sh</executable>
<workingDirectory>${jbossHome}/bin</workingDirectory>
<arguments>
<argument>--file=${project.build.directory}/classes/cli/read-domain-interface.cli</argument>
</arguments>
<outputFile>${project.build.directory}/master-domain-interface.txt</outputFile>
</configuration>
</execution>
<execution> <execution>
<id>read-master-domain-standalone</id> <id>read-master-domain-standalone</id>
<phase>process-classes</phase> <phase>process-classes</phase>
@ -363,6 +408,51 @@
<outputFile>${project.build.directory}/migrated-standalone-ha.txt</outputFile> <outputFile>${project.build.directory}/migrated-standalone-ha.txt</outputFile>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>read-migrated-domain-core-service</id>
<phase>process-test-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.sh</executable>
<workingDirectory>${jbossHome}/bin</workingDirectory>
<arguments>
<argument>--file=${project.build.directory}/classes/cli/read-domain-core-service.cli</argument>
</arguments>
<outputFile>${project.build.directory}/migrated-domain-core-service.txt</outputFile>
</configuration>
</execution>
<execution>
<id>read-migrated-domain-extension</id>
<phase>process-test-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.sh</executable>
<workingDirectory>${jbossHome}/bin</workingDirectory>
<arguments>
<argument>--file=${project.build.directory}/classes/cli/read-domain-extension.cli</argument>
</arguments>
<outputFile>${project.build.directory}/migrated-domain-extension.txt</outputFile>
</configuration>
</execution>
<execution>
<id>read-migrated-domain-interface</id>
<phase>process-test-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./jboss-cli.sh</executable>
<workingDirectory>${jbossHome}/bin</workingDirectory>
<arguments>
<argument>--file=${project.build.directory}/classes/cli/read-domain-interface.cli</argument>
</arguments>
<outputFile>${project.build.directory}/migrated-domain-interface.txt</outputFile>
</configuration>
</execution>
<execution> <execution>
<id>read-migrated-domain-standalone</id> <id>read-migrated-domain-standalone</id>
<phase>process-test-resources</phase> <phase>process-test-resources</phase>

View file

@ -0,0 +1,3 @@
embed-host-controller --domain-config=domain.xml
/core-service=management/:read-resource(recursive=true)

View file

@ -0,0 +1,3 @@
embed-host-controller --domain-config=domain.xml
/extension=*/:read-resource(recursive=true)

View file

@ -0,0 +1,3 @@
embed-host-controller --domain-config=domain.xml
/interface=*/:read-resource(recursive=true)

View file

@ -1,3 +1,4 @@
embed-server --server-config=standalone-ha.xml embed-server --server-config=standalone-ha.xml
/subsystem=*/:read-resource(recursive=true) #/subsystem=*/:read-resource(recursive=true)
:read-resource(recursive=true)

View file

@ -1,3 +1,4 @@
embed-server --server-config=standalone.xml embed-server --server-config=standalone.xml
/subsystem=*/:read-resource(recursive=true) #/subsystem=*/:read-resource(recursive=true)
:read-resource(recursive=true)

View file

@ -64,6 +64,10 @@ public class ConfigMigrationTest {
public void testDomain() throws IOException { public void testDomain() throws IOException {
compareConfigs("master-domain-standalone.txt", "migrated-domain-standalone.txt"); compareConfigs("master-domain-standalone.txt", "migrated-domain-standalone.txt");
compareConfigs("master-domain-clustered.txt", "migrated-domain-clustered.txt"); compareConfigs("master-domain-clustered.txt", "migrated-domain-clustered.txt");
compareConfigs("master-domain-core-service.txt", "migrated-domain-core-service.txt");
compareConfigs("master-domain-extension.txt", "migrated-domain-extension.txt");
compareConfigs("master-domain-interface.txt", "migrated-domain-interface.txt");
} }
private void compareConfigs(String masterConfig, String migratedConfig) throws IOException { private void compareConfigs(String masterConfig, String migratedConfig) throws IOException {