Skip to content

Commit

Permalink
Merge branch 'feature/#247_sakuli_se' into feature/247-sakuli-se
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Schneck committed Apr 22, 2018
2 parents b5c2d3e + e6bd7a4 commit 6cd4784
Show file tree
Hide file tree
Showing 593 changed files with 6,789 additions and 1,568 deletions.
24 changes: 14 additions & 10 deletions docker/sakuli-client/src_java/common/install/sakuli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ set -e
EXAMPLE_URL=https://github.com/ConSol/sakuli-examples
echo "Install Sakuli Java Example: Maven $EXAMPLE_URL to $SAKULI_TEST_SUITE"

mkdir -p /tmp/sakuli-example
cd /tmp/sakuli-example
tmpdir=/tmp/sakuli-example
mkdir -p $tmpdir
cd $tmpdir
wget $EXAMPLE_URL/archive/master.zip
unzip *.zip
mkdir -p "$SAKULI_TEST_SUITE"
mv sakuli-examples-master/java-example/* "$SAKULI_TEST_SUITE"
rm -rf /tmp/sakuli-example

echo "Download Sakuli dependencies for v$SAKULI_VERSION"
cd $SAKULI_TEST_SUITE
ls -la
## clean target after build, so only dependencies are here
mvn test clean -Duser.home=$HOME -Dtest=TriggerDownload -DfailIfNoTests=false -Dsakuli.version=$SAKULI_VERSION
for javasuite in "java-selenium-example" "java-example"; do
echo "Download Sakuli dependencies for v$SAKULI_VERSION"
cd $tmpdir/sakuli-examples-master/$javasuite
ls -la
## clean target after build, so only dependencies are here
mvn test clean -Duser.home=$HOME -Dtest=TriggerDownload -DfailIfNoTests=false -Dsakuli.version=$SAKULI_VERSION
done
rm -rf "$SAKULI_TEST_SUITE"
mv $tmpdir/sakuli-examples-master/java-example "$SAKULI_TEST_SUITE"
ls -la "$SAKULI_TEST_SUITE"
rm -rvf $tmpdir

echo "add -Dsakuli.version=$SAKULI_VERSION to Maven startup"
echo "export MAVEN_OPTS=-Dsakuli.version=$SAKULI_VERSION" >> $HOME/.bashrc
Expand Down
4 changes: 2 additions & 2 deletions docs/manual/development/installation-developers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ Setup a local MySQL database to save the results of test case executions. The da
* *User:* `sakuli`
* *Password:* `sakuli`
* *Database:* `sakuli`
* *SQL-Script:* git-link:src/common/src/main/resources/org/sakuli/common/setup/database/create_sakuli_database.sql[link-text="create_sakuli_database.sql", mode="view", link-window="_blank"]
* *SQL-Script:* git-link:src/sakuli-common/src/main/resources/org/sakuli/common/setup/database/create_sakuli_database.sql[link-text="create_sakuli_database.sql", mode="view", link-window="_blank"]

If you want to use a Docker-Container, you can build and run it with the following commands:

[source,bash]
----
cd src/common/src/main/resources/org/sakuli/common/setup/database/create_sakuli_database
cd src/sakuli-common/src/main/resources/org/sakuli/common/setup/database/create_sakuli_database
docker build -t=your-user/mysql-sakuli .
docker run --name mysql-sakuli -p 3306:3306 your-user/mysql-sakuli
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter"/>
<option name="VM_PARAMETERS" value=""/>
<option name="PROGRAM_PARAMETERS"
value="--run dev_stuff/suites/ubuntu --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="--run dev_stuff/suites/ubuntu --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$"/>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
<option name="ALTERNATIVE_JRE_PATH" value=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter"/>
<option name="VM_PARAMETERS" value=""/>
<option name="PROGRAM_PARAMETERS"
value="--run dev_stuff/suites/windows --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="--run dev_stuff/suites/windows --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$"/>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
<option name="ALTERNATIVE_JRE_PATH" value=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter"/>
<option name="VM_PARAMETERS" value=""/>
<option name="PROGRAM_PARAMETERS"
value="--run ../../example_test_suites/example_macos --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="--run ../../example_test_suites/example_macos --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$"/>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
<option name="ALTERNATIVE_JRE_PATH" value=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter"/>
<option name="VM_PARAMETERS" value=""/>
<option name="PROGRAM_PARAMETERS"
value="--run ../../example_test_suites/example_ubuntu --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="--run ../../example_test_suites/example_ubuntu --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$"/>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
<option name="ALTERNATIVE_JRE_PATH" value=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS"
value="--run ../../example_test_suites/example_windows7 --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="--run ../../example_test_suites/example_windows7 --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter"/>
<option name="VM_PARAMETERS" value=""/>
<option name="PROGRAM_PARAMETERS"
value="--run ../../example_test_suites/example_windows8 --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="--run ../../example_test_suites/example_windows8 --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$"/>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
<option name="ALTERNATIVE_JRE_PATH"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<option name="MAIN_CLASS_NAME" value="org.sakuli.starter.SakuliStarter"/>
<option name="VM_PARAMETERS" value=""/>
<option name="PROGRAM_PARAMETERS"
value="-run path_to_test_suites/_your_test_suite --sakuli_home ../common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
value="-run path_to_test_suites/_your_test_suite --sakuli_home ../sakuli-common/src/main/resources/org/sakuli/common --sahi_home ../../sahi"/>
<option name="WORKING_DIRECTORY" value="file://$MODULE_DIR$"/>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false"/>
<option name="ALTERNATIVE_JRE_PATH" value=""/>
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/integration/monitoring/checkmk.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ With the implementation of the Check_MK forwarder a new http://jtwig.org/[Jtwig]

In near time, all other forwarder modules of Sakuli will support the templating feature too.

Sakuli comes with default templates, which are placed in `$INSTALL_DIR/config/templates`. The git-link:src/common/src/main/resources/org/sakuli/common/config/templates/check_mk[link-text="default Check_MK templates", mode="view", link-window="_blank"] can be found in a subdirectory `check_mk`.
Sakuli comes with default templates, which are placed in `$INSTALL_DIR/config/templates`. The git-link:src/sakuli-common/src/main/resources/org/sakuli/common/config/templates/check_mk[link-text="default Check_MK templates", mode="view", link-window="_blank"] can be found in a subdirectory `check_mk`.

For further information how the default template directory can be changed or how the forwarder templates can be customized please refer to <<forwarder-template>>.
2 changes: 1 addition & 1 deletion docs/manual/integration/monitoring/icinga2api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ sakuli.forwarder.icinga2.api.password=icingasakuli
sakuli.forwarder.icinga2.hostname=sakuliclient01
----

For other *OPTIONAL* gearman parameters you can adjust, see git-link:src/common/src/main/resources/org/sakuli/common/config/sakuli-default.properties[link-text="sakuli-default.properties", mode="view", link-window="_blank"] file.
For other *OPTIONAL* gearman parameters you can adjust, see git-link:src/sakuli-common/src/main/resources/org/sakuli/common/config/sakuli-default.properties[link-text="sakuli-default.properties", mode="view", link-window="_blank"] file.

.Test result transmission to Icinga2

Expand Down
28 changes: 19 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.sakuli</groupId>
<artifactId>root</artifactId>
<artifactId>sakuli-root</artifactId>
<version>1.2.0-247-sakuli-se-SNAPSHOT</version>
<packaging>pom</packaging>

Expand All @@ -34,13 +34,17 @@
<url>http://maven.apache.org</url>

<modules>
<module>src/common</module>
<module>src/ocr-tessdata-extractor</module>
<module>src/basic-test-util</module>
<module>src/sakuli-common</module>
<module>src/docs-sakuli-api</module>
<module>src/docs-manual</module>
<module>src/core</module>
<module>src/sakuli-core</module>
<module>src/sakuli-sahi-setup</module>
<module>src/sakuli-installer</module>
<module>src/sakuli-java-dsl</module>
<module>src/sakuli-selenium-setup</module>
<module>src/integration-test</module>
<module>src/java-dsl</module>
<module>src/installer</module>
</modules>

<properties>
Expand Down Expand Up @@ -68,6 +72,7 @@
<dependencies.spring.version>4.1.4.RELEASE</dependencies.spring.version>
<dependencies.aspectj.version>1.8.2</dependencies.aspectj.version>
<dependencies.jersey-client.version>2.22.2</dependencies.jersey-client.version>
<dependencies.slf4j.version>1.7.7</dependencies.slf4j.version>
<dependencies.izpack.version>5.0.6</dependencies.izpack.version>

<!--testing related properties-->
Expand Down Expand Up @@ -499,16 +504,21 @@
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${dependencies.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.7</version>
<version>${dependencies.slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.7</version>
<version>${dependencies.slf4j.version}</version>
</dependency>

<!-- will rout the system out from sikulX to logging over slf4j -->
Expand Down Expand Up @@ -537,7 +547,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<version>2.5</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
Expand All @@ -547,7 +557,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
<version>3.5</version>
</dependency>

<!-- Sahi Library (OpenSource Version)-->
Expand Down
117 changes: 117 additions & 0 deletions src/basic-test-util/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Sakuli - Testing and Monitoring-Tool for Websites and common UIs.
~
~ Copyright 2013 - 2015 the original author or authors.
~
~ 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 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sakuli</groupId>
<artifactId>sakuli-root</artifactId>
<version>1.2.0-247-sakuli-se-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>basic-test-util</artifactId>
<version>1.2.0-247-sakuli-se-SNAPSHOT</version>
<name>${project.artifactId}</name>

<description>basic module for some internal testing stuff</description>

<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

<profiles>
<!--profile on deployment of the artifacts-->
<profile>
<id>upload</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<!-- plugins for source and java-doc files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>test-jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.1.4.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
56 changes: 56 additions & 0 deletions src/basic-test-util/src/test/java/org/sakuli/AbstractBaseTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Sakuli - Testing and Monitoring-Tool for Websites and common UIs.
*
* Copyright 2013 - 2015 the original author or authors.
*
* 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.sakuli;

import java.nio.file.Paths;

import static org.testng.Assert.assertTrue;

/**
* @author tschneck Date: 25.07.13
*/
public abstract class AbstractBaseTest extends AbstractLogAwareTest {

public static final String SAKULI_HOME_FOLDER_PATH = Paths.get("../sakuli-common/src/main/resources/org/sakuli/common")
.toAbsolutePath().normalize().toString();
public static final String TEST_FOLDER_PATH = getResource("/_testsuite4JUnit");
public static final String TEST_CONTEXT_PATH = "JUnit-beanRefFactory.xml";

public static void assertRegExMatch(String string, String regex) {
assertTrue(string.matches(regex),
String.format("string '%s' won't match to regex '%s'", string, regex));
}

public static void assertContains(String string, String contains) {
assertTrue(string.contains(contains),
String.format("string '%s' won't contain '%s'", string, contains));
}

protected String getTestContextPath() {
return TEST_CONTEXT_PATH;
}

protected String getSakuliHomeFolderPath() {
return SAKULI_HOME_FOLDER_PATH;
}

protected String getTestFolderPath() {
return TEST_FOLDER_PATH;
}
}
Loading

0 comments on commit 6cd4784

Please sign in to comment.