Skip to content

Commit

Permalink
Modification: changes in pom, auto start, test, auto stop configured
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed Jul 20, 2018
1 parent eca9e28 commit 7833bb9
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 41 deletions.
1 change: 1 addition & 0 deletions build-system/pom.xml
Expand Up @@ -94,6 +94,7 @@
<reflections.version>0.9.11</reflections.version>
<guava.version>20.0</guava.version>
<jcommander.version>1.72</jcommander.version>
<failsafe.version>2.22.0</failsafe.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
8 changes: 4 additions & 4 deletions gui/admin-gui/pom.xml
Expand Up @@ -102,16 +102,16 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<wait>1000</wait> <!-- POSSIBLY OBSOLETE ! : Added because spring-boot:start goal -->
<maxAttempts>150</maxAttempts><!-- POSSIBLY OBSOLETE ! : Added because spring-boot:start goal -->
<wait>1000</wait> <!-- TODO POSSIBLY OBSOLETE ! : Added because spring-boot:start goal -->
<maxAttempts>150</maxAttempts><!-- TODO POSSIBLY OBSOLETE ! : Added because spring-boot:start goal -->
<fork>true</fork>
<excludeDevtools>true</excludeDevtools>
<skip>false</skip>
<!-- POSSIBLY OBSOLETE ! -->
<!-- TODO POSSIBLY OBSOLETE ! -->
<!--<noverify>true</noverify>-->
<!--<jvmArguments>"-Dcom.sun.management.jmxremote.port=20002","-Djava.rmi.server.hostname=0.0.0.0"</jvmArguments>-->
<!--<jmxPort>20002</jmxPort>-->

<jvmArguments>"-Dmidpoint.schrodinger=true"</jvmArguments><!-- TODO question: CAN this argument be active by default, or should be there a different profile defined for this? -->
</configuration>
<executions>
<execution>
Expand Down
90 changes: 60 additions & 30 deletions testing/schrodingertest/pom.xml
Expand Up @@ -17,6 +17,7 @@
<project.build.directory>C:\Users\matus\Documents\mp3.7\midpoint\gui\admin-gui\target</project.build.directory>
<!--<project.starter.module>/c/Users/matus/Documents/mp3.7/midpoint/gui/admin-gui</project.starter.module>-->
<project.starter.module>../../gui/admin-gui</project.starter.module>
<project.app.package.name>com.evolveum.midpoint.web.boot.MidPointSpringApplication</project.app.package.name>
</properties>

<dependencies>
Expand Down Expand Up @@ -211,19 +212,24 @@
<build>
<plugins>

<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-failsafe-plugin</artifactId>-->
<!--<version>2.19.1</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>integration-test</goal>-->
<!--<goal>verify</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe.version}</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng-integration-schrodinger.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<!--<plugin>-->
<!--<artifactId>maven-dependency-plugin</artifactId>-->
Expand Down Expand Up @@ -311,39 +317,63 @@

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<version>${antrun.version}</version>
<executions>
<execution>
<phase>pre-integration-test</phase>
<configuration>
<target>
<exec dir="." executable="cmd"
spawn="true">
<target name="####### Midpoint ${project.version} booting up for integration testing">
<exec dir="." executable="cmd" osfamily="windows" spawn="true">
<arg value="/c"/>
<arg value="mvn"/>
<arg value="-f"/>
<arg value="${project.starter.module}/pom.xml"/>
<arg value="spring-boot:run"/>
</exec>
<sleep seconds="200" /><!-- Needed so MP boots up, but the whole thing is quite hackish -->
<exec dir="." executable="bash" osfamily="unix" spawn="true">
<arg value="mvn"/>
<arg value="-f"/>
<arg value="${project.starter.module}/pom.xml"/>
<arg value="spring-boot:run"/>
</exec>
<sleep seconds="230" /><!--TODO CHANGE! (This should be rather the concern of the tests) : Needed so MP boots up, but the whole thing is quite hackish and depends on the environment (and almost the weather)-->
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>Shut-down-process</id>
<phase>post-integration-test</phase>
<configuration>
<target name="####### Shuting down Midpoint ${project.version} after integration testing completed">
<exec executable="jps"> <!-- TODO ok?: JDK needed to be referenced on the PATH-->
<arg value="-l" />
<redirector outputproperty="process.pid">
<outputfilterchain>
<linecontains>
<contains value="${project.app.package.name}" />
</linecontains>
<replacestring from=" ${project.app.package.name}" />
</outputfilterchain>
</redirector>
</exec>
<exec executable="taskkill" osfamily="windows">
<arg value="/PID" />
<arg value="${process.pid}" />
<arg value="/F" /> <!-- TODO ok?: Had to force this-->
</exec>
<exec executable="kill" osfamily="unix">
<arg value="-15" />
<arg value="${process.pid}" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!--<execution>-->
<!--<id>sleep-for-a-while</id>-->
<!--<phase>integration-test</phase>-->
<!--<configuration>-->
<!--<target>-->
<!--<sleep seconds="300" />-->
<!--</target>-->
<!--</configuration>-->
<!--<goals>-->
<!--<goal>run</goal>-->
<!--</goals>-->
<!--</execution>-->
</executions>
</plugin>

Expand Down
Expand Up @@ -12,7 +12,7 @@
/**
* Created by matus on 5/11/2018.
*/
public class UserPhotoTestsIT extends TestBase {
public class UserPhotoTests extends TestBase {

private static final String TEST_USER_LEO_NAME= "leonardo";
private static final File PHOTO_SOURCE_FILE_LARGE = new File("./src/test/resources/images/leonardo_large_nc.jpg");
Expand Down
25 changes: 25 additions & 0 deletions testing/schrodingertest/testng-integration-schrodinger.xml
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015 Evolveum
~
~ 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.
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="integration" parallel="false" verbose="1">
<test name="Schrodinger" preserve-order="true" parallel="false" verbose="10" enabled="true">
<classes>
<class name="com.evolveum.midpoint.testing.schrodinger.TestSuiteConfig"/>
<class name="com.evolveum.midpoint.testing.schrodinger.scenarios.UserPhotoTests"/>
</classes>
</test>
</suite>
6 changes: 0 additions & 6 deletions testing/schrodingertest/testng-integration.xml
Expand Up @@ -16,10 +16,4 @@
-->
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="integration" parallel="false" verbose="1">
<test name="Schrodinger" preserve-order="true" parallel="false" verbose="10" enabled="true">
<classes>
<class name="com.evolveum.midpoint.testing.schrodinger.TestSuiteConfig"/>
<class name="com.evolveum.midpoint.testing.schrodinger.scenarios.UserPhotoTestsIT"/>
</classes>
</test>
</suite>

0 comments on commit 7833bb9

Please sign in to comment.