clean project
This commit is contained in:
parent
474817403d
commit
bfbbee6aea
@ -21,7 +21,7 @@ Das neue Paket-Modul ist in Entwicklung https://dev.hostsharing.net/doc/hsadmin!
|
|||||||
|
|
||||||
## run locally
|
## run locally
|
||||||
|
|
||||||
Alles bauen und Eclise Konfiguration erzeugen:
|
Alles bauen und Eclipse Konfiguration erzeugen:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mvn clean install eclipse:clean eclipse
|
mvn clean install eclipse:clean eclipse
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>hsadmin-cli</artifactId>
|
<artifactId>hsadmin-cli</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.2.0</version>
|
||||||
@ -17,12 +17,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>framework</artifactId>
|
<artifactId>framework</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>de.hsadmin</groupId>
|
|
||||||
<artifactId>framework</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlrpc</groupId>
|
<groupId>org.apache.xmlrpc</groupId>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package de.hsadmin.jscli.conf;
|
package de.hsadmin.jscli.conf;
|
||||||
|
|
||||||
import org.apache.commons.cli.CommandLine;
|
import org.apache.commons.cli.CommandLine;
|
||||||
|
import org.apache.commons.cli.DefaultParser;
|
||||||
import org.apache.commons.cli.HelpFormatter;
|
import org.apache.commons.cli.HelpFormatter;
|
||||||
import org.apache.commons.cli.Options;
|
import org.apache.commons.cli.Options;
|
||||||
import org.apache.commons.cli.ParseException;
|
import org.apache.commons.cli.ParseException;
|
||||||
import org.apache.commons.cli.PosixParser;
|
|
||||||
|
|
||||||
import de.hsadmin.common.config.Config;
|
import de.hsadmin.common.config.Config;
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
import de.hsadmin.common.error.TechnicalException;
|
||||||
@ -24,7 +24,7 @@ public class CommandlineParser {
|
|||||||
opts.addOption("e", "expr", true, "expression to execute");
|
opts.addOption("e", "expr", true, "expression to execute");
|
||||||
opts.addOption("f", "file", true, "script file to execute");
|
opts.addOption("f", "file", true, "script file to execute");
|
||||||
opts.addOption("i", "interactive", false, "interactive shell");
|
opts.addOption("i", "interactive", false, "interactive shell");
|
||||||
PosixParser parser = new PosixParser();
|
DefaultParser parser = new DefaultParser();
|
||||||
try {
|
try {
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
printHelp();
|
printHelp();
|
||||||
|
@ -62,7 +62,7 @@ public class ConsoleWrapper implements PasswordReader {
|
|||||||
|
|
||||||
public String readPassword() throws TechnicalException {
|
public String readPassword() throws TechnicalException {
|
||||||
try {
|
try {
|
||||||
final String pw = cons.readLine("Password: ", new Character('*'));
|
final String pw = cons.readLine("Password: ", Character.valueOf('*'));
|
||||||
cons.setPrompt(prompt);
|
cons.setPrompt(prompt);
|
||||||
return pw;
|
return pw;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
<project name="jpa_enhance_builder">
|
|
||||||
<path id="enhance.cp">
|
|
||||||
<pathelement location="${basedir}${file.separator}${build.dir}"/>
|
|
||||||
<fileset dir="${basedir}${file.separator}${openjpa.libs}">
|
|
||||||
<include name="**/*.jar"/>
|
|
||||||
</fileset>
|
|
||||||
</path>
|
|
||||||
<property name="cp" refid="enhance.cp"/>
|
|
||||||
<target name="openjpa.libs.check" unless="openjpa.libs">
|
|
||||||
<fail message="Please set -Dopenjpa.libs in your builder configuration!"/>
|
|
||||||
</target>
|
|
||||||
<target name="build.dir.check" unless="build.dir">
|
|
||||||
<fail message="Please set -Dbuild.dir in your builder configuration!"/>
|
|
||||||
</target>
|
|
||||||
<target name="enhance" depends="openjpa.libs.check, build.dir.check">
|
|
||||||
<echo message="${cp}"/>
|
|
||||||
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
|
|
||||||
<classpath refid="enhance.cp"/>
|
|
||||||
</taskdef>
|
|
||||||
<openjpac>
|
|
||||||
<classpath refid="enhance.cp"/>
|
|
||||||
</openjpac>
|
|
||||||
</target>
|
|
||||||
</project>
|
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>cust-webapp</artifactId>
|
<artifactId>cust-webapp</artifactId>
|
||||||
@ -16,64 +16,47 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>framework</artifactId>
|
<artifactId>framework</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>${hsadmin.version}</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>de.hsadmin</groupId>
|
|
||||||
<artifactId>framework</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<type>test-jar</type>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-jpa_2.0_spec</artifactId>
|
<artifactId>geronimo-jpa_2.2_spec</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-ejb_3.0_spec</artifactId>
|
<artifactId>geronimo-ejb_3.1_spec</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-validation_1.0_spec</artifactId>
|
<artifactId>geronimo-validation_2.0_spec</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.bval</groupId>
|
<groupId>org.apache.bval</groupId>
|
||||||
<artifactId>org.apache.bval.bundle</artifactId>
|
<artifactId>org.apache.bval.bundle</artifactId>
|
||||||
<version>0.5</version>
|
<version>${bval.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.openjpa</groupId>
|
<groupId>org.apache.openjpa</groupId>
|
||||||
<artifactId>openjpa</artifactId>
|
<artifactId>openjpa</artifactId>
|
||||||
<version>2.4.2</version>
|
<version>${openjpa.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId>
|
|
||||||
<version>2.3.4</version> <scope>test</scope> </dependency> -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.h2database</groupId>
|
|
||||||
<artifactId>h2</artifactId>
|
|
||||||
<version>1.4.194</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId>
|
|
||||||
<version>10.13.1.1</version> <scope>test</scope> </dependency> -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>${liquibase.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlrpc</groupId>
|
<groupId>org.apache.xmlrpc</groupId>
|
||||||
<artifactId>xmlrpc-server</artifactId>
|
<artifactId>xmlrpc-server</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>${xmlrpc.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
@ -105,72 +88,19 @@
|
|||||||
<exclude>**/XmlRpcServlet.properties</exclude>
|
<exclude>**/XmlRpcServlet.properties</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-a-jar</id>
|
|
||||||
<phase>compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.apache.tomee.maven</groupId>
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-artifacts</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>attach-artifact</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<artifacts>
|
|
||||||
<artifact>
|
|
||||||
<file>${project.basedir}/target/cust-webapp-1.0-SNAPSHOT.jar</file>
|
|
||||||
<type>jar</type>
|
|
||||||
</artifact>
|
|
||||||
</artifacts>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
|
||||||
<version>1.6.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>migratePostgresLiquibaseChangeLogToH2</id>
|
|
||||||
<phase>generate-sources</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>exec</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<executable>${project.basedir}/scripts/migratePostgresLiquibaseChangeLogToH2.${script.extension}</executable>
|
|
||||||
<arguments>
|
|
||||||
<argument>${project.parent.basedir}/db-migration/src/main/resources/liquibase/db.changelog.xml</argument>
|
|
||||||
<argument>${project.build.directory}/classes/liquibase/db.changelog.xml</argument>
|
|
||||||
</arguments>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.openejb.maven</groupId>
|
|
||||||
<artifactId>tomee-maven-plugin</artifactId>
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
<version>1.7.4</version>
|
<version>${tomee.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<tomeeVersion>1.7.4</tomeeVersion>
|
<tomeeVersion>${tomee.version}</tomeeVersion>
|
||||||
<tomeeClassifier>webprofile</tomeeClassifier>
|
<tomeeClassifier>webprofile</tomeeClassifier>
|
||||||
<debug>false</debug>
|
<debug>false</debug>
|
||||||
<debugPort>8000</debugPort>
|
<debugPort>8000</debugPort>
|
||||||
<context>cust-webapp</context>
|
|
||||||
<config>${project.basedir}/src/test/tomee/conf</config>
|
<config>${project.basedir}/src/test/tomee/conf</config>
|
||||||
<libs>
|
<libs>
|
||||||
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
|
<lib>${postgresql.lib}</lib>
|
||||||
</libs>
|
</libs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
@ -196,8 +126,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.openjpa</groupId>
|
<groupId>org.apache.openjpa</groupId>
|
||||||
<artifactId>openjpa</artifactId>
|
<artifactId>openjpa</artifactId>
|
||||||
<!-- set the version to be the same as the level in your runtime -->
|
<version>${openjpa.version}</version>
|
||||||
<version>2.4.2</version>
|
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
mkdir -p $(dirname "$2")
|
|
||||||
sed \
|
|
||||||
-e's/ deferrable="[a-z]*" initiallyDeferred="[a-z]*"//' \
|
|
||||||
-e's/ type="INET"/ type="VARCHAR(19)"/' \
|
|
||||||
-e'/generated.69/,+5d' \
|
|
||||||
<"$1" >"$2"
|
|
||||||
|
|
||||||
# -e'/changeset.* id="generated-69"/,+5d' \
|
|
@ -1,23 +0,0 @@
|
|||||||
package de.hsadmin.bo.customer;
|
|
||||||
|
|
||||||
import static de.hsadmin.test.PojoTestUtil.*;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.PojoTestUtil;
|
|
||||||
|
|
||||||
public class CustomerPackageBoPojoTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void ensureProperSetterGetterImplementations() {
|
|
||||||
PojoTestUtil.ensureProperSetterGetterImplementations("de.hsadmin.bo.customer",
|
|
||||||
include(de.hsadmin.bo.customer.Contact.class),
|
|
||||||
include(de.hsadmin.bo.customer.Customer.class),
|
|
||||||
include(de.hsadmin.bo.customer.IndicatorVAT.class),
|
|
||||||
include(de.hsadmin.bo.customer.SEPADirectDebit.class),
|
|
||||||
include(de.hsadmin.bo.customer.MemberShare.class),
|
|
||||||
include(de.hsadmin.bo.customer.MemberShareAction.class),
|
|
||||||
include(de.hsadmin.bo.customer.MemberAsset.class),
|
|
||||||
include(de.hsadmin.bo.customer.MemberAssetAction.class));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package de.hsadmin.bo.customer;
|
|
||||||
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.dao.customer.CustomerDaoTest;
|
|
||||||
import de.hsadmin.test.JpaBasedTest;
|
|
||||||
|
|
||||||
public class MemberAssetTest extends JpaBasedTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testMemberAssetAgainstDatabase() {
|
|
||||||
// given
|
|
||||||
Customer customer = store(CustomerDaoTest.createNewCustomer(10001, "testCust"));
|
|
||||||
|
|
||||||
// when
|
|
||||||
MemberAsset newEntity = store(createNewMemberAsset(customer));
|
|
||||||
MemberAsset foundEntity = getEM().find(MemberAsset.class, newEntity.getId());
|
|
||||||
|
|
||||||
// then
|
|
||||||
assertEquals(newEntity.toString(), foundEntity.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MemberAsset createNewMemberAsset(final Customer customer) {
|
|
||||||
MemberAsset newEntity = new MemberAsset();
|
|
||||||
newEntity.setCustomer(customer);
|
|
||||||
newEntity.setAction(MemberAssetAction.PAYMENT);
|
|
||||||
newEntity.setDate(new LocalDate(2017, 4, 13).toDate());
|
|
||||||
newEntity.setAmount(new BigDecimal("1234.56"));
|
|
||||||
newEntity.setComment("test comment");
|
|
||||||
return newEntity;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package de.hsadmin.bo.customer;
|
|
||||||
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.dao.customer.CustomerDaoTest;
|
|
||||||
import de.hsadmin.test.JpaBasedTest;
|
|
||||||
|
|
||||||
public class MemberShareTest extends JpaBasedTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testMemberShareAgainstDatabase() {
|
|
||||||
// given
|
|
||||||
Customer customer = store(CustomerDaoTest.createNewCustomer(10001, "testCust"));
|
|
||||||
|
|
||||||
// when
|
|
||||||
MemberShare newEntity = store(createNewMemberShare(customer));
|
|
||||||
MemberShare foundEntity = getEM().find(MemberShare.class, newEntity.getId());
|
|
||||||
|
|
||||||
// then
|
|
||||||
assertEquals(newEntity.toString(), foundEntity.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MemberShare createNewMemberShare(final Customer customer) {
|
|
||||||
MemberShare newEntity = new MemberShare();
|
|
||||||
newEntity.setCustomer(customer);
|
|
||||||
newEntity.setAction(MemberShareAction.SUBSCRIPTION);
|
|
||||||
newEntity.setDate(new LocalDate(2017, 4, 13).toDate());
|
|
||||||
newEntity.setQuantity(5);
|
|
||||||
newEntity.setComment("test comment");
|
|
||||||
return newEntity;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package de.hsadmin.bo.domain;
|
|
||||||
|
|
||||||
import static de.hsadmin.test.PojoTestUtil.*;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.PojoTestUtil;
|
|
||||||
|
|
||||||
public class DomainPackageBoTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void ensureProperSetterGetterImplementations() {
|
|
||||||
PojoTestUtil.ensureProperSetterGetterImplementations("de.hsadmin.bo.domain",
|
|
||||||
include(de.hsadmin.bo.domain.Domain.class),
|
|
||||||
include(de.hsadmin.bo.domain.DomainOption.class),
|
|
||||||
include(de.hsadmin.bo.domain.EMailAddress.class));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package de.hsadmin.bo.pac;
|
|
||||||
|
|
||||||
import static de.hsadmin.test.PojoTestUtil.*;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.PojoTestUtil;
|
|
||||||
|
|
||||||
public class PacPackageBoPojoTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void ensureProperSetterGetterImplementations() {
|
|
||||||
PojoTestUtil.ensureProperSetterGetterImplementations("de.hsadmin.bo.pac",
|
|
||||||
include(de.hsadmin.bo.pac.Hive.class),
|
|
||||||
include(de.hsadmin.bo.pac.BasePac.class),
|
|
||||||
include(de.hsadmin.bo.pac.Pac.class),
|
|
||||||
include(de.hsadmin.bo.pac.Component.class),
|
|
||||||
include(de.hsadmin.bo.pac.BaseComponent.class),
|
|
||||||
include(de.hsadmin.bo.pac.PacComponent.class),
|
|
||||||
include(de.hsadmin.bo.pac.EMailAlias.class),
|
|
||||||
include(de.hsadmin.bo.pac.UnixUser.class),
|
|
||||||
include(de.hsadmin.bo.pac.INetAddress.class),
|
|
||||||
exclude(de.hsadmin.bo.pac.PacEntityListener.class));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
package de.hsadmin.dao.customer;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.bo.customer.Customer;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
import de.hsadmin.test.JpaBasedTest;
|
|
||||||
|
|
||||||
public class CustomerDaoTest extends JpaBasedTest {
|
|
||||||
|
|
||||||
private CustomerDao customerDao;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void init() {
|
|
||||||
customerDao = new CustomerDao(getEM());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void findCustomerByName() throws UserException {
|
|
||||||
Customer newCustomer = store(createNewCustomer(100001, "test"));
|
|
||||||
|
|
||||||
Customer foundCustomer = customerDao.findCustomerByName(newCustomer.getName());
|
|
||||||
assertEquals(newCustomer.getId(), foundCustomer.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Customer createNewCustomer(int memberNo, String memberCode) {
|
|
||||||
Customer newCustomer = new Customer();
|
|
||||||
newCustomer.setMemberNo(memberNo);
|
|
||||||
newCustomer.setName(memberCode);
|
|
||||||
return newCustomer;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class ContactRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(ContactServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("contact");
|
|
||||||
thenModuleInstantiatesServiceOfClass(ContactService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class CustomerRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(CustomerServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("customer");
|
|
||||||
thenModuleInstantiatesServiceOfClass(CustomerService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class MemberAssetRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberAssetServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(MemberAssetServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("memberAsset");
|
|
||||||
thenModuleInstantiatesServiceOfClass(MemberAssetService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class MemberShareRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(MemberShareServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("memberShare");
|
|
||||||
thenModuleInstantiatesServiceOfClass(MemberShareService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,148 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.NotImplementedException;
|
|
||||||
import org.joda.time.LocalDate;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.rules.ExpectedException;
|
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.mockito.Mockito;
|
|
||||||
import org.mockito.MockitoAnnotations;
|
|
||||||
|
|
||||||
import de.hsadmin.bo.customer.Customer;
|
|
||||||
import de.hsadmin.bo.customer.MemberShare;
|
|
||||||
import de.hsadmin.bo.customer.MemberShareAction;
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
import de.hsadmin.dao.customer.CustomerDao;
|
|
||||||
import de.hsadmin.login.RequestContext;
|
|
||||||
import de.hsadmin.login.Role;
|
|
||||||
import de.hsadmin.test.CauseMatcher;
|
|
||||||
|
|
||||||
public class MemberShareServiceTest {
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private RequestContext requestContextMock;
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private EntityManager emMock;
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private CustomerDao customerDaoMock;
|
|
||||||
|
|
||||||
@Rule
|
|
||||||
public ExpectedException expectedExeption = ExpectedException.none();
|
|
||||||
|
|
||||||
private MemberShareService memberShareService;
|
|
||||||
|
|
||||||
protected List<MemberShare> memberSharesCriteriaQueryResult;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void init() {
|
|
||||||
MockitoAnnotations.initMocks(this);
|
|
||||||
memberShareService = new MemberShareService(emMock, customerDaoMock) {
|
|
||||||
@Override
|
|
||||||
List<MemberShare> runCriteriaQuery(MemberShareVO criteria) throws UserException, TechnicalException {
|
|
||||||
return memberSharesCriteriaQueryResult;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void buildVO() throws TechnicalException {
|
|
||||||
MemberShareVO newVO = memberShareService.buildVO();
|
|
||||||
assertEquals(new MemberShareVO().toString(), newVO.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void create() throws TechnicalException, UserException {
|
|
||||||
// given
|
|
||||||
givenLoginRole(Role.SYSTEM);
|
|
||||||
MemberShareVO prototypeVO = MemberShareVOTest.givenInitializedMemberShareVOForCustomer(givenFakeCustomerWithName("testCust").getName());
|
|
||||||
|
|
||||||
// when
|
|
||||||
MemberShareVO createdVO = memberShareService.create(requestContextMock, prototypeVO);
|
|
||||||
|
|
||||||
// then
|
|
||||||
assertEquals(prototypeVO.toString(), createdVO.toString());
|
|
||||||
Mockito.verify(emMock, Mockito.only()).persist(Mockito.any(MemberShare.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void read() throws TechnicalException, UserException {
|
|
||||||
// given
|
|
||||||
givenLoginRole(Role.SYSTEM);
|
|
||||||
Customer fakeCustomer = givenFakeCustomerWithName("testCust");
|
|
||||||
MemberShareVO prototypeVO = MemberShareVOTest.givenEmptyMemberShareVOForCustomer(fakeCustomer.getName());
|
|
||||||
MemberShare memberShare1 = givenFakeMemberShare(fakeCustomer, MemberShareAction.SUBSCRIPTION, 4 );
|
|
||||||
MemberShare memberShare2 = givenFakeMemberShare(fakeCustomer, MemberShareAction.UNSUBSCRIPTION, 2 );
|
|
||||||
givenCriteriaQueryResult(prototypeVO, memberShare1, memberShare2);
|
|
||||||
|
|
||||||
// when
|
|
||||||
List<MemberShareVO> readVOs = memberShareService.read(requestContextMock, prototypeVO);
|
|
||||||
|
|
||||||
// then
|
|
||||||
assertEquals(2, readVOs.size());
|
|
||||||
assertEquals("MemberShareVO [customer=testCust, action=SUBSCRIPTION, date=Fri Apr 14 00:00:00 CEST 2017, quantity=4, comment=some comment]", readVOs.get(0).toString());
|
|
||||||
assertEquals("MemberShareVO [customer=testCust, action=UNSUBSCRIPTION, date=Fri Apr 14 00:00:00 CEST 2017, quantity=2, comment=some comment]", readVOs.get(1).toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void update() throws TechnicalException, UserException {
|
|
||||||
MemberShareVO prototypeVO = MemberShareVOTest.givenInitializedMemberShareVOForCustomer("testCust");
|
|
||||||
|
|
||||||
// then
|
|
||||||
expectedExeption.expect(TechnicalException.class);
|
|
||||||
expectedExeption.expectCause(new CauseMatcher(NotImplementedException.class, "MemberShares are immutable"));
|
|
||||||
|
|
||||||
// when
|
|
||||||
memberShareService.update(requestContextMock, prototypeVO, prototypeVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void delete() throws TechnicalException, UserException {
|
|
||||||
MemberShareVO prototypeVO = MemberShareVOTest.givenInitializedMemberShareVOForCustomer("testCust");
|
|
||||||
|
|
||||||
// then
|
|
||||||
expectedExeption.expect(TechnicalException.class);
|
|
||||||
expectedExeption.expectCause(new CauseMatcher(NotImplementedException.class, "MemberShares are immutable"));
|
|
||||||
|
|
||||||
// when
|
|
||||||
memberShareService.delete(requestContextMock, prototypeVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
// === test fixture ===
|
|
||||||
|
|
||||||
private void givenLoginRole(Role role) {
|
|
||||||
Mockito.when(requestContextMock.getLoginRole()).thenReturn(role);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Customer givenFakeCustomerWithName(String name) throws UserException {
|
|
||||||
Customer fakeCustomer = new Customer();
|
|
||||||
fakeCustomer.setName(name);
|
|
||||||
Mockito.when(customerDaoMock.findCustomerByName(name)).thenReturn(fakeCustomer);
|
|
||||||
return fakeCustomer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private MemberShare givenFakeMemberShare(Customer customer, MemberShareAction action, int quantity) {
|
|
||||||
MemberShare share = new MemberShare();
|
|
||||||
share.setCustomer(customer);
|
|
||||||
share.setAction(action);
|
|
||||||
share.setQuantity(quantity);
|
|
||||||
share.setDate(new LocalDate(2017, 4, 14).toDate());
|
|
||||||
share.setComment("some comment");
|
|
||||||
return share;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void givenCriteriaQueryResult(MemberShareVO prototypeVO, MemberShare... memberShare) {
|
|
||||||
memberSharesCriteriaQueryResult = Arrays.asList(memberShare);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,198 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import static junitparams.JUnitParamsRunner.$;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
|
||||||
import org.junit.Rule;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.rules.ExpectedException;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import de.hsadmin.bo.customer.MemberShare;
|
|
||||||
import de.hsadmin.bo.customer.MemberShareTest;
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
import de.hsadmin.dao.customer.CustomerDaoTest;
|
|
||||||
import de.hsadmin.module.impl.ValidationDelegate;
|
|
||||||
import de.hsadmin.module.property.Property;
|
|
||||||
import junitparams.JUnitParamsRunner;
|
|
||||||
import junitparams.Parameters;
|
|
||||||
|
|
||||||
@RunWith(JUnitParamsRunner.class)
|
|
||||||
public class MemberShareVOTest {
|
|
||||||
|
|
||||||
private static final String INITIAL_COMMENT = "initial comment";
|
|
||||||
|
|
||||||
private static final LocalDate INITIAL_DATE = new LocalDate(1996, 12, 26);
|
|
||||||
|
|
||||||
private static final String INITIAL_ACTION = "SUBSCRIPTION";
|
|
||||||
|
|
||||||
private static final String INITIAL_CUSTOMER = "initCust";
|
|
||||||
|
|
||||||
private static final int INITIAL_QUANTITY = 4;
|
|
||||||
|
|
||||||
private static final String INITIALIZED_MEMBER_SHARE_VO_AS_STRING = "MemberShareVO [customer=initCust, action=SUBSCRIPTION, date=Thu Dec 26 00:00:00 CET 1996, quantity=4, comment=initial comment]";
|
|
||||||
|
|
||||||
private final ValidationDelegate<MemberShareVO> validator = new ValidationDelegate<MemberShareVO>();
|
|
||||||
|
|
||||||
@Rule
|
|
||||||
public final ExpectedException exception = ExpectedException.none();
|
|
||||||
|
|
||||||
// --- special tests ---
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void toStringTest() throws TechnicalException, UserException {
|
|
||||||
|
|
||||||
MemberShareVO vo = givenInitializedMemberShareVOForCustomer(INITIAL_CUSTOMER);
|
|
||||||
|
|
||||||
// ACHTUNG:
|
|
||||||
// Wenn die toString() Implementierung geaendert wurde,
|
|
||||||
// koennten auch andere Tests fehlschlagen.
|
|
||||||
// Wenn Felder aus dem toString() herausgenommen werden,
|
|
||||||
// koennten sogar andere Tests stillschweigend wirkungslos werden!
|
|
||||||
assertEquals(INITIALIZED_MEMBER_SHARE_VO_AS_STRING, vo.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void copyPropertiesFromPersistentObject() throws TechnicalException, UserException {
|
|
||||||
// given
|
|
||||||
MemberShare bo = MemberShareTest.createNewMemberShare(CustomerDaoTest.createNewCustomer(10001, "testCust"));
|
|
||||||
|
|
||||||
// when
|
|
||||||
MemberShareVO vo = new MemberShareVO();
|
|
||||||
vo.copyPropertiesFromPersistentObject(bo);
|
|
||||||
|
|
||||||
// then
|
|
||||||
assertEquals("MemberShareVO [customer=testCust, action=SUBSCRIPTION, date=Thu Apr 13 00:00:00 CEST 2017, quantity=5, comment=test comment]",
|
|
||||||
vo.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void copyPropertiesToPersistentObject() throws TechnicalException, UserException {
|
|
||||||
// given
|
|
||||||
MemberShareVO vo = givenInitializedMemberShareVOForCustomer(INITIAL_CUSTOMER);
|
|
||||||
|
|
||||||
// when
|
|
||||||
MemberShare bo = new MemberShare();
|
|
||||||
vo.copyPropertiesToPersistentObject(bo);
|
|
||||||
|
|
||||||
// then (Achtung: customer muss vom Service umkopiert werden)
|
|
||||||
assertEquals("MemberShare [id=0, customer=null, date=Thu Dec 26 00:00:00 CET 1996, action=SUBSCRIPTION, quantity=4, comment=initial comment]",
|
|
||||||
bo.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- generic tests ---
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Parameters(method = "properties")
|
|
||||||
public void propertyIsRequired(final String propertyName) throws UserException, TechnicalException {
|
|
||||||
MemberShareVO initializedMemberShareVO = givenInitializedMemberShareVOForCustomer(INITIAL_CUSTOMER);
|
|
||||||
initializedMemberShareVO.get(propertyName).setValue(null);
|
|
||||||
assertInitialPropertyValueIsNull(initializedMemberShareVO, propertyName);
|
|
||||||
assertPrototypeIsNotCreateable(initializedMemberShareVO, "MSG_REQUIRED_FIELD: " + propertyName);
|
|
||||||
}
|
|
||||||
public static Object[] properties() {
|
|
||||||
return $(
|
|
||||||
// nur die Properties auffuehren, die 'required' sind
|
|
||||||
"customer",
|
|
||||||
"action",
|
|
||||||
"date",
|
|
||||||
"quantity",
|
|
||||||
"comment"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Parameters(method = "propertiesWithInitialValues")
|
|
||||||
public void propertyIsCreatable(final String propertyName, final Object initialValue) throws UserException, TechnicalException {
|
|
||||||
MemberShareVO initializedMemberShareVO = givenInitializedMemberShareVOForCustomer(INITIAL_CUSTOMER);
|
|
||||||
assertInitialPropertyValue(initializedMemberShareVO, propertyName, initialValue);
|
|
||||||
assertPrototypeIsCreateable(initializedMemberShareVO);
|
|
||||||
}
|
|
||||||
public static Object[] propertiesWithInitialValues() {
|
|
||||||
return $(
|
|
||||||
// nur die Properties auffuehren, die 'creatable' sind
|
|
||||||
$("customer", INITIAL_CUSTOMER),
|
|
||||||
$("action", INITIAL_ACTION),
|
|
||||||
$("date", INITIAL_DATE.toDate()),
|
|
||||||
$("quantity", + INITIAL_QUANTITY),
|
|
||||||
$("comment", INITIAL_COMMENT)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Parameters(method = "propertiesWithChangedValues")
|
|
||||||
public void propertyIsNotUpdateable(final String propertyName, final Object changedValue) throws UserException, TechnicalException {
|
|
||||||
MemberShareVO initializedMemberShareVO = givenInitializedMemberShareVOForCustomer(INITIAL_CUSTOMER);
|
|
||||||
assertChangedPropertyValue(initializedMemberShareVO, propertyName, changedValue);
|
|
||||||
assertPrototypeIsNotUpdateable(initializedMemberShareVO, "MSG_NO_FIELD_WRITEACCESS: " + propertyName);
|
|
||||||
}
|
|
||||||
public static Object[] propertiesWithChangedValues() {
|
|
||||||
return $(
|
|
||||||
// nur die Properties auffuehren, die NICHT 'updateable' sind
|
|
||||||
$("customer", INITIAL_CUSTOMER + "Changed"),
|
|
||||||
$("action", "UN" + INITIAL_ACTION),
|
|
||||||
$("date", INITIAL_DATE.plusDays(1).toDate()),
|
|
||||||
$("quantity", + INITIAL_QUANTITY * 2),
|
|
||||||
$("comment", INITIAL_COMMENT + "Changed")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// === test fixture ===
|
|
||||||
|
|
||||||
public static MemberShareVO givenEmptyMemberShareVOForCustomer(String customerName) throws TechnicalException, UserException {
|
|
||||||
MemberShareVO memberShareVO = new MemberShareVO();
|
|
||||||
memberShareVO.setCustomer(customerName);
|
|
||||||
return memberShareVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MemberShareVO givenInitializedMemberShareVOForCustomer(String customerName) throws TechnicalException, UserException {
|
|
||||||
MemberShareVO memberShareVO = new MemberShareVO();
|
|
||||||
memberShareVO.setCustomer(customerName);
|
|
||||||
memberShareVO.setAction(INITIAL_ACTION);
|
|
||||||
memberShareVO.setDate( INITIAL_DATE.toDate() );
|
|
||||||
memberShareVO.setQuantity(INITIAL_QUANTITY);
|
|
||||||
memberShareVO.setComment(INITIAL_COMMENT);
|
|
||||||
memberShareVO.initPropertyValues();
|
|
||||||
return memberShareVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertInitialPropertyValueIsNull(final MemberShareVO memberShareVO, final String propertyName) throws UserException, TechnicalException {
|
|
||||||
assertNull(memberShareVO.get(propertyName).getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertInitialPropertyValue(final MemberShareVO memberShareVO, final String propertyName, final Object expectedValue) throws UserException, TechnicalException {
|
|
||||||
assertEquals(expectedValue, memberShareVO.get(propertyName).getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T> void assertChangedPropertyValue(final MemberShareVO memberShareVO, final String propertyName, final T changedValue) throws UserException, TechnicalException {
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Property<T> customerProp = (Property<T>) memberShareVO.get(propertyName);
|
|
||||||
customerProp.setValue(changedValue);
|
|
||||||
assertEquals(changedValue, customerProp.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertPrototypeIsCreateable(final MemberShareVO memberShareVO) throws UserException, TechnicalException {
|
|
||||||
validator.checkPrototypeIsCreateable(memberShareVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertPrototypeIsNotCreateable(final MemberShareVO someMemberShareVO, final String expectedMessage) throws UserException, TechnicalException {
|
|
||||||
exception.expect(UserException.class);
|
|
||||||
exception.expectMessage(expectedMessage);
|
|
||||||
validator.checkPrototypeIsCreateable(someMemberShareVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assertPrototypeIsNotUpdateable(final MemberShareVO someMemberShareVO, final String expectedMessage) throws UserException, TechnicalException {
|
|
||||||
exception.expect(UserException.class);
|
|
||||||
exception.expectMessage(expectedMessage);
|
|
||||||
validator.checkPrototypeIsUpdateable(someMemberShareVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate asDate(String input) {
|
|
||||||
return LocalDate.parse(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.customer;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class SEPADirectDebitRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(SEPADirectDebitServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("mandat");
|
|
||||||
thenModuleInstantiatesServiceOfClass(SEPADirectDebitService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.pac;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class HiveRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(HiveServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("hive");
|
|
||||||
thenModuleInstantiatesServiceOfClass(HiveService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package de.hsadmin.service.pac;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
public class PacRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
// givenRegisteredModuleLookupFor(PacServiceLocal.class);
|
|
||||||
// whenServiceIsRetrievedFromRemoteRegistryKey("pac");
|
|
||||||
// thenModuleInstantiatesServiceOfClass(PacService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
package de.hsadmin.test;
|
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
|
||||||
import javax.persistence.EntityManagerFactory;
|
|
||||||
import javax.persistence.EntityTransaction;
|
|
||||||
import javax.persistence.Persistence;
|
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
|
|
||||||
import liquibase.Liquibase;
|
|
||||||
import liquibase.database.Database;
|
|
||||||
import liquibase.database.DatabaseFactory;
|
|
||||||
import liquibase.database.jvm.JdbcConnection;
|
|
||||||
import liquibase.resource.ClassLoaderResourceAccessor;
|
|
||||||
|
|
||||||
public abstract class JpaBasedTest {
|
|
||||||
|
|
||||||
private static final String UNIT_NAME = "HSADMIN_H2_TEST_DB";
|
|
||||||
|
|
||||||
private static final EntityManagerFactory emf = Persistence.createEntityManagerFactory(UNIT_NAME);
|
|
||||||
|
|
||||||
private EntityManager em;
|
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setupDatabase() throws Exception {
|
|
||||||
EntityManager em = emf.createEntityManager();
|
|
||||||
java.sql.Connection connection = em.unwrap(java.sql.Connection.class);
|
|
||||||
em.getTransaction().begin();
|
|
||||||
try {
|
|
||||||
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection));
|
|
||||||
Liquibase liquibase = new Liquibase("liquibase/db.changelog.xml", new ClassLoaderResourceAccessor(), database);
|
|
||||||
liquibase.update("test");
|
|
||||||
} finally {
|
|
||||||
em.getTransaction().commit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void startTransaction() {
|
|
||||||
em = emf.createEntityManager();
|
|
||||||
em.getTransaction().begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
@After
|
|
||||||
public void rollbacktransaction() {
|
|
||||||
// make sure constraint violations are found
|
|
||||||
em.flush();
|
|
||||||
|
|
||||||
// but rollback the transaction
|
|
||||||
try {
|
|
||||||
EntityTransaction transaction = em.getTransaction();
|
|
||||||
if ( transaction.isActive() ) {
|
|
||||||
em.getTransaction().rollback();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
// and close the EntityManager
|
|
||||||
if (em.isOpen()) {
|
|
||||||
em.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityManager getEM() {
|
|
||||||
return em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public <T> T store(T newEntity) {
|
|
||||||
getEM().persist(newEntity);
|
|
||||||
getEM().flush();
|
|
||||||
getEM().clear();
|
|
||||||
return newEntity;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
package de.hsadmin.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.openpojo.reflection.PojoClass;
|
|
||||||
import com.openpojo.reflection.PojoClassFilter;
|
|
||||||
import com.openpojo.reflection.filters.FilterChain;
|
|
||||||
import com.openpojo.reflection.filters.FilterClassName;
|
|
||||||
import com.openpojo.reflection.filters.FilterNestedClasses;
|
|
||||||
import com.openpojo.reflection.filters.FilterPackageInfo;
|
|
||||||
import com.openpojo.reflection.impl.PojoClassFactory;
|
|
||||||
import com.openpojo.validation.Validator;
|
|
||||||
import com.openpojo.validation.ValidatorBuilder;
|
|
||||||
import com.openpojo.validation.test.impl.GetterTester;
|
|
||||||
import com.openpojo.validation.test.impl.SetterTester;
|
|
||||||
|
|
||||||
public class PojoTestUtil {
|
|
||||||
|
|
||||||
public static void ensureProperSetterGetterImplementations(final String packageUnderTest, String... expectedClasseNames ) {
|
|
||||||
ensureExpectedClassesAreTested(packageUnderTest, Arrays.asList(expectedClasseNames) );
|
|
||||||
|
|
||||||
Validator validator = ValidatorBuilder.create()
|
|
||||||
// See com.openpojo.validation.test.impl for more ...
|
|
||||||
.with(new SetterTester())
|
|
||||||
.with(new GetterTester())
|
|
||||||
.build();
|
|
||||||
validator.validate(packageUnderTest, new FilterPackageInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String include(Class<?> clazz) {
|
|
||||||
return clazz.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String exclude(Class<?> clazz) {
|
|
||||||
return clazz.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ensureExpectedClassesAreTested(final String packageUnderTest, final List<String> expectedClassNames) {
|
|
||||||
Collections.sort(expectedClassNames);
|
|
||||||
List<String> pojoClasseNames = new ArrayList<String>();
|
|
||||||
for ( PojoClass p: PojoClassFactory.getPojoClasses(packageUnderTest,
|
|
||||||
new FilterChain(new FilterPackageInfo(), new FilterNestedClasses(), new FilterInverse(new FilterClassName(".*Test$"))) ) ) {
|
|
||||||
pojoClasseNames.add( p.getClazz().getName() );
|
|
||||||
}
|
|
||||||
Collections.sort(pojoClasseNames);
|
|
||||||
|
|
||||||
assertEquals("precondition failed", expectedClassNames.toString().replaceAll(", ", "\n"), pojoClasseNames.toString().replaceAll(", ", "\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class FilterInverse implements PojoClassFilter {
|
|
||||||
|
|
||||||
private PojoClassFilter delegate;
|
|
||||||
|
|
||||||
public FilterInverse(PojoClassFilter delegate) {
|
|
||||||
this.delegate = delegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean include(PojoClass pojoClass) {
|
|
||||||
return !delegate.include(pojoClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>database-webapp</artifactId>
|
<artifactId>database-webapp</artifactId>
|
||||||
@ -15,42 +15,34 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>framework</artifactId>
|
<artifactId>framework</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>${hsadmin.version}</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>de.hsadmin</groupId>
|
|
||||||
<artifactId>framework</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<type>test-jar</type>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>cust-webapp</artifactId>
|
<artifactId>cust-webapp</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>${hsadmin.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-jpa_2.0_spec</artifactId>
|
<artifactId>geronimo-jpa_2.2_spec</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-ejb_3.0_spec</artifactId>
|
<artifactId>geronimo-ejb_3.1_spec</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-validation_1.0_spec</artifactId>
|
<artifactId>geronimo-validation_2.0_spec</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlrpc</groupId>
|
<groupId>org.apache.xmlrpc</groupId>
|
||||||
<artifactId>xmlrpc-server</artifactId>
|
<artifactId>xmlrpc-server</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>${xmlrpc.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
@ -63,27 +55,17 @@
|
|||||||
<finalName>database-webapp</finalName>
|
<finalName>database-webapp</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.apache.tomee.maven</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<archiveClasses>true</archiveClasses>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.openejb.maven</groupId>
|
|
||||||
<artifactId>tomee-maven-plugin</artifactId>
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
<version>1.7.4</version>
|
<version>${tomee.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<tomeeVersion>1.7.4</tomeeVersion>
|
<tomeeVersion>${tomee.version}</tomeeVersion>
|
||||||
<tomeeClassifier>webprofile</tomeeClassifier>
|
<tomeeClassifier>webprofile</tomeeClassifier>
|
||||||
<debug>false</debug>
|
<debug>false</debug>
|
||||||
<debugPort>8000</debugPort>
|
<debugPort>8000</debugPort>
|
||||||
<config>${project.basedir}/src/test/tomee/conf</config>
|
<config>${project.basedir}/src/test/tomee/conf</config>
|
||||||
<libs>
|
<libs>
|
||||||
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
|
<lib>${postgresql.lib}</lib>
|
||||||
</libs>
|
</libs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package de.hsadmin.service.database;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class MySqlDatabaseRemoteTest extends de.hsadmin.test.BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(MySqlDatabaseServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("mysqldb");
|
|
||||||
// thenModuleInstantiatesServiceOfClass(MySqlDatabaseService.class); FIXME
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,7 +4,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>db-migration</artifactId>
|
<artifactId>db-migration</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
@ -12,13 +12,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>${servlet.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>${liquibase.version}</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@ -26,17 +26,17 @@
|
|||||||
<finalName>db-migration</finalName>
|
<finalName>db-migration</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.openejb.maven</groupId>
|
<groupId>org.apache.tomee.maven</groupId>
|
||||||
<artifactId>tomee-maven-plugin</artifactId>
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
<version>1.7.4</version>
|
<version>${tomee.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<tomeeVersion>1.7.4</tomeeVersion>
|
<tomeeVersion>${tomee.version}</tomeeVersion>
|
||||||
<tomeeClassifier>webprofile</tomeeClassifier>
|
<tomeeClassifier>webprofile</tomeeClassifier>
|
||||||
<debug>false</debug>
|
<debug>false</debug>
|
||||||
<debugPort>8000</debugPort>
|
<debugPort>8000</debugPort>
|
||||||
<config>${project.basedir}/src/test/tomee/conf</config>
|
<config>${project.basedir}/src/test/tomee/conf</config>
|
||||||
<libs>
|
<libs>
|
||||||
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
|
<lib>${postgresql.lib}</lib>
|
||||||
</libs>
|
</libs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -1,124 +1,65 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||||
http://maven.apache.org/maven-v4_0_0.xsd">
|
http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>framework</artifactId>
|
<artifactId>framework</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HSAdmin Framework</name>
|
<name>HSAdmin Framework</name>
|
||||||
|
|
||||||
<build>
|
<dependencies>
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<!--
|
|
||||||
<configuration>
|
|
||||||
<testFailureIgnore>true</testFailureIgnore>
|
|
||||||
</configuration>
|
|
||||||
-->
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>3.0.2</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>test-jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
|
||||||
<artifactId>geronimo-jpa_2.0_spec</artifactId>
|
|
||||||
<version>1.1</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
|
||||||
<artifactId>geronimo-ejb_3.0_spec</artifactId>
|
|
||||||
<version>1.0.1</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
|
||||||
<artifactId>geronimo-validation_1.0_spec</artifactId>
|
|
||||||
<version>1.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.bval</groupId>
|
|
||||||
<artifactId>org.apache.bval.bundle</artifactId>
|
|
||||||
<version>0.5</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlrpc</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>xmlrpc-server</artifactId>
|
<artifactId>geronimo-jpa_2.2_spec</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>1.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>geronimo-ejb_3.1_spec</artifactId>
|
||||||
<version>1.2.17</version>
|
<version>1.0.2</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>joda-time</artifactId>
|
<artifactId>geronimo-validation_2.0_spec</artifactId>
|
||||||
<version>2.9.9</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--
|
<dependency>
|
||||||
<dependency>
|
<groupId>org.apache.bval</groupId>
|
||||||
<groupId>org.hsqldb</groupId>
|
<artifactId>org.apache.bval.bundle</artifactId>
|
||||||
<artifactId>hsqldb</artifactId>
|
<version>${bval.version}</version>
|
||||||
<version>2.3.4</version>
|
<scope>test</scope>
|
||||||
<scope>test</scope>
|
</dependency>
|
||||||
</dependency>
|
<dependency>
|
||||||
-->
|
<groupId>org.apache.xmlrpc</groupId>
|
||||||
<dependency>
|
<artifactId>xmlrpc-server</artifactId>
|
||||||
<groupId>com.h2database</groupId>
|
<version>${xmlrpc.version}</version>
|
||||||
<artifactId>h2</artifactId>
|
</dependency>
|
||||||
<version>1.4.194</version>
|
<dependency>
|
||||||
<scope>test</scope>
|
<groupId>log4j</groupId>
|
||||||
</dependency>
|
<artifactId>log4j</artifactId>
|
||||||
<!--
|
<version>${log4j.version}</version>
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>org.apache.derby</groupId>
|
<dependency>
|
||||||
<artifactId>derby</artifactId>
|
<groupId>org.apache.openjpa</groupId>
|
||||||
<version>10.13.1.1</version>
|
<artifactId>openjpa</artifactId>
|
||||||
<scope>test</scope>
|
<version>${openjpa.version}</version>
|
||||||
</dependency>
|
<scope>test</scope>
|
||||||
-->
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.openjpa</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>openjpa</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>2.4.2</version>
|
<version>${liquibase.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
</dependencies>
|
||||||
<groupId>org.liquibase</groupId>
|
|
||||||
<artifactId>liquibase-core</artifactId>
|
|
||||||
<version>3.5.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ public class CASTicketValidator implements TicketValidator {
|
|||||||
}
|
}
|
||||||
nextLine = reader.readLine();
|
nextLine = reader.readLine();
|
||||||
}
|
}
|
||||||
|
reader.close();
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
throw new UserException(new UserError(UserError.MSG_INVALID_TICKET));
|
throw new UserException(new UserError(UserError.MSG_INVALID_TICKET));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -18,7 +18,6 @@ public class DefaultEnumParameterMapMapper implements ParameterMapMapper<Enum<?>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Enum<?> readValueFromParameterMap(Map<String, Object> rpcParameter,
|
public Enum<?> readValueFromParameterMap(Map<String, Object> rpcParameter,
|
||||||
final String propertyName, final Class<?> propertyClass)
|
final String propertyName, final Class<?> propertyClass)
|
||||||
throws TechnicalException, UserException {
|
throws TechnicalException, UserException {
|
||||||
|
@ -25,9 +25,9 @@ public class DefaultEnumPersistentObjectMapper implements PersistentObjectMapper
|
|||||||
public void writeValueToPersistentObject(Object persistentObject, String propertyName, String value)
|
public void writeValueToPersistentObject(Object persistentObject, String propertyName, String value)
|
||||||
throws TechnicalException, UserException {
|
throws TechnicalException, UserException {
|
||||||
|
|
||||||
Class<?> propertyClass = ReflectionUtil.getFieldType(persistentObject, propertyName);
|
final Class<?> propertyClass = ReflectionUtil.getFieldType(persistentObject, propertyName);
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Enum<?> enumValue = Enum.valueOf(propertyClass.asSubclass(Enum.class), value);
|
final Enum<?> enumValue = Enum.valueOf(propertyClass.asSubclass(Enum.class), value);
|
||||||
ReflectionUtil.invokeSetter(persistentObject, propertyName, enumValue);
|
ReflectionUtil.invokeSetter(persistentObject, propertyName, enumValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,150 +0,0 @@
|
|||||||
package de.hsadmin.module.property;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertSame;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
import de.hsadmin.module.ValueObject;
|
|
||||||
import de.hsadmin.module.impl.AbstractVO;
|
|
||||||
import de.hsadmin.module.property.mapping.DefaultBigDecimalPersistentObjectMapper;
|
|
||||||
import de.hsadmin.module.property.mapping.DefaultStringParameterMapMapper;
|
|
||||||
import de.hsadmin.module.property.mapping.Mapping;
|
|
||||||
|
|
||||||
public class BigDecimalPropertyTest {
|
|
||||||
|
|
||||||
private final TestBO testBO = new TestBO();
|
|
||||||
|
|
||||||
private TestVO testVO;
|
|
||||||
private Property<BigDecimal> voPropertyFrontendConverted;
|
|
||||||
private Property<BigDecimal> voPropertyBackendConverted;
|
|
||||||
private Map<String, Object> rpcParameterMap = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
@Before
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public void init() throws TechnicalException, UserException {
|
|
||||||
testVO = new TestVO();
|
|
||||||
testVO.amountFrontendConverted = new BigDecimal("9876.43");
|
|
||||||
testVO.amountBackendConverted = new BigDecimal("1234.56");
|
|
||||||
testVO.initPropertyValues();
|
|
||||||
|
|
||||||
voPropertyFrontendConverted = (Property<BigDecimal>) testVO.get("amountFrontendConverted");
|
|
||||||
voPropertyBackendConverted = (Property<BigDecimal>) testVO.get("amountBackendConverted");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore("MHOENNIG: muss mit PHORMANNS geklaert werden, warum es diese PersistenceMapper ueberhaupt gibt, scheinen mir sinnlos ")
|
|
||||||
public void effectivePersistentObjectMapperIsDefaultBigDecimalPersistentObjectMapper() throws TechnicalException, UserException {
|
|
||||||
// VO -> BO
|
|
||||||
voPropertyBackendConverted.setValue(new BigDecimal("1234.56"));
|
|
||||||
// FIXME MHOENNIG->PHORMANNS:
|
|
||||||
// in writeValueToPersistentObject(...) haette ich die Konvertierung erwartet,
|
|
||||||
// aber auch beim DefaultDatePersistentObjectMapper ist gerade da keine Konvertierung,
|
|
||||||
// so nun zunaechst auch analog beim DefaultBigDecimalPersistentObjectMapper.
|
|
||||||
voPropertyBackendConverted.copyValueToPersistentObject(testBO);
|
|
||||||
assertEquals("1234.56", testBO.amountBackendConverted);
|
|
||||||
|
|
||||||
// BO -> VO
|
|
||||||
testBO.amountBackendConverted = "1111.11";
|
|
||||||
voPropertyBackendConverted.copyValueFromPersistentObject(testBO);
|
|
||||||
assertEquals("1111.11", testVO.amountBackendConverted);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void effectiveParameterMapMapperIsDefaultBigDecimalParameterMapMapper() throws TechnicalException, UserException {
|
|
||||||
// VO -> rpcParameterMap
|
|
||||||
voPropertyFrontendConverted.setValue(new BigDecimal("1234.56"));
|
|
||||||
voPropertyFrontendConverted.copyValueToParameterMap(rpcParameterMap);;
|
|
||||||
assertEquals("1234.56", rpcParameterMap.get("amountFrontendConverted"));
|
|
||||||
|
|
||||||
// rpcParameterMap -> VO
|
|
||||||
rpcParameterMap.put("amountFrontendConverted", "1111.11");
|
|
||||||
voPropertyFrontendConverted.copyValueFromParameterMap(rpcParameterMap);
|
|
||||||
assertEquals(new BigDecimal("1111.11"), testVO.amountFrontendConverted);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getValueTypeIsBigDecimal() {
|
|
||||||
assertSame(BigDecimal.class, voPropertyFrontendConverted.getValueType());
|
|
||||||
}
|
|
||||||
|
|
||||||
// === test fixture ===
|
|
||||||
|
|
||||||
public static class TestVO extends AbstractVO implements ValueObject {
|
|
||||||
|
|
||||||
@ReadWrite(ReadWritePolicy.READWRITE)
|
|
||||||
@Required(true)
|
|
||||||
@Search(SearchPolicy.COMPARE)
|
|
||||||
private BigDecimal amountFrontendConverted;
|
|
||||||
|
|
||||||
@Mapping(boMapping=DefaultBigDecimalPersistentObjectMapper.class,
|
|
||||||
rpcMapping=DefaultStringParameterMapMapper.class)
|
|
||||||
@ReadWrite(ReadWritePolicy.READWRITE)
|
|
||||||
@Required(true)
|
|
||||||
@Search(SearchPolicy.LIKE)
|
|
||||||
private BigDecimal amountBackendConverted;
|
|
||||||
|
|
||||||
|
|
||||||
public TestVO() throws TechnicalException {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getAmountFrontendConverted() {
|
|
||||||
return amountFrontendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setAmountFrontendConverted(BigDecimal amountFrontendConverted) {
|
|
||||||
this.amountFrontendConverted = amountFrontendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getAmountBackendConverted() {
|
|
||||||
return amountBackendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setAmountBackendConverted(BigDecimal amountBackendConverted) {
|
|
||||||
this.amountBackendConverted = amountBackendConverted;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class TestBO {
|
|
||||||
|
|
||||||
@ReadWrite(ReadWritePolicy.READWRITE)
|
|
||||||
@Required(true)
|
|
||||||
@Search(SearchPolicy.COMPARE)
|
|
||||||
private BigDecimal amountFrontendConverted;
|
|
||||||
|
|
||||||
@ReadWrite(ReadWritePolicy.READWRITE)
|
|
||||||
@Required(true)
|
|
||||||
@Search(SearchPolicy.LIKE)
|
|
||||||
private String amountBackendConverted;
|
|
||||||
|
|
||||||
public BigDecimal getAmountFrontendConverted() {
|
|
||||||
return amountFrontendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmountFrontendConverted(BigDecimal amountFrontendConverted) {
|
|
||||||
this.amountFrontendConverted = amountFrontendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAmountBackendConverted() {
|
|
||||||
return amountBackendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAmountBackendConverted(String amountBackendConverted) {
|
|
||||||
this.amountBackendConverted = amountBackendConverted;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
package de.hsadmin.module.property.mapping;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertNull;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
|
|
||||||
public class DefaultBigDecimalParameterMapMapperTest {
|
|
||||||
|
|
||||||
private final Map<String, Object> rpcParameters = new HashMap<String, Object>();
|
|
||||||
private final DefaultBigDecimalParameterMapMapper defaultBigDecimalParameterMapMapper = new DefaultBigDecimalParameterMapMapper();
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromParameterMapWithNumericString() throws TechnicalException, UserException{
|
|
||||||
rpcParameters.put("test", "1234.56");
|
|
||||||
assertEquals(new BigDecimal("1234.56"), defaultBigDecimalParameterMapMapper.readValueFromParameterMap(rpcParameters, "test", BigDecimal.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expected=TechnicalException.class)
|
|
||||||
public void readValueFromParameterMapWithNonNumericString() throws TechnicalException, UserException{
|
|
||||||
rpcParameters.put("test", "not a number");
|
|
||||||
defaultBigDecimalParameterMapMapper.readValueFromParameterMap(rpcParameters, "test", BigDecimal.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expected=TechnicalException.class)
|
|
||||||
public void readValueFromParameterMapWithNumericStringWithGarbage() throws TechnicalException, UserException{
|
|
||||||
rpcParameters.put("test", "1234x");
|
|
||||||
defaultBigDecimalParameterMapMapper.readValueFromParameterMap(rpcParameters, "test", BigDecimal.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromParameterMapWithBigDecimal() throws TechnicalException, UserException{
|
|
||||||
rpcParameters.put("test", new BigDecimal("1234.56"));
|
|
||||||
assertEquals(new BigDecimal("1234.56"), defaultBigDecimalParameterMapMapper.readValueFromParameterMap(rpcParameters, "test", BigDecimal.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromParameterMapWithBigOther() throws TechnicalException, UserException{
|
|
||||||
rpcParameters.put("test", new Date());
|
|
||||||
assertNull(defaultBigDecimalParameterMapMapper.readValueFromParameterMap(rpcParameters, "test", BigDecimal.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void writeValueToParameterMap() throws TechnicalException, UserException{
|
|
||||||
defaultBigDecimalParameterMapMapper.writeValueToParameterMap(rpcParameters, "test", new BigDecimal("9876.64"));
|
|
||||||
assertEquals("9876.64", rpcParameters.get("test"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void writeNullValueToParameterMap() throws TechnicalException, UserException{
|
|
||||||
defaultBigDecimalParameterMapMapper.writeValueToParameterMap(rpcParameters, "test", null);
|
|
||||||
assertFalse(rpcParameters.containsKey("test"));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
package de.hsadmin.module.property.mapping;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
|
|
||||||
public class DefaultBigDecimalPersistentObjectMapperTest {
|
|
||||||
|
|
||||||
private DefaultBigDecimalPersistentObjectMapper mapper = new DefaultBigDecimalPersistentObjectMapper();
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromPersistentObjectHavingEnum() throws TechnicalException, UserException {
|
|
||||||
SomeBO persistentObject = new SomeBO(new BigDecimal("1234.56"));
|
|
||||||
assertEquals( new BigDecimal("1234.56"), mapper.readValueFromPersistentObject(persistentObject, "someBigDecimalProp"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromPersistentObjectHavingString() throws TechnicalException, UserException {
|
|
||||||
SomeBO persistentObject = new SomeBO(new BigDecimal("9876.54"));
|
|
||||||
assertEquals( new BigDecimal("9876.54"), mapper.readValueFromPersistentObject(persistentObject, "someStringProp"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void writeValueToPersistentObject() throws TechnicalException, UserException {
|
|
||||||
SomeBO persistentObject = new SomeBO(new BigDecimal(0));
|
|
||||||
mapper.writeValueToPersistentObject(persistentObject, "someBigDecimalProp", new BigDecimal("3333.44") );
|
|
||||||
assertEquals(new BigDecimal("3333.44"), persistentObject.getSomeBigDecimalProp());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SomeBO {
|
|
||||||
|
|
||||||
private BigDecimal someBigDecimalProp;
|
|
||||||
private String someStringProp;
|
|
||||||
|
|
||||||
public SomeBO(BigDecimal someProp) {
|
|
||||||
this.someBigDecimalProp = someProp;
|
|
||||||
this.someStringProp = someProp.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getSomeBigDecimalProp() {
|
|
||||||
return someBigDecimalProp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSomeBigDecimalProp(BigDecimal someProp) {
|
|
||||||
this.someBigDecimalProp = someProp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSomeStringProp() {
|
|
||||||
return someStringProp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSomeStringProp(String someStringProp) {
|
|
||||||
this.someStringProp = someStringProp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
package de.hsadmin.module.property.mapping;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
|
|
||||||
public class DefaultEnumParameterMapMapperTest {
|
|
||||||
|
|
||||||
private static enum SomeEnum { A, B };
|
|
||||||
|
|
||||||
private static final Map<String, Object> rpcParameters = new HashMap<String, Object>();
|
|
||||||
static {
|
|
||||||
rpcParameters.put("testA", "A");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromParameterMap() throws TechnicalException, UserException{
|
|
||||||
assertEquals(SomeEnum.A, new DefaultEnumParameterMapMapper().readValueFromParameterMap(rpcParameters, "testA", SomeEnum.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void writeValueToParameterMap() throws TechnicalException, UserException{
|
|
||||||
new DefaultEnumParameterMapMapper().writeValueToParameterMap(rpcParameters, "testB", SomeEnum.B);
|
|
||||||
assertEquals("B", rpcParameters.get("testB"));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,69 +0,0 @@
|
|||||||
package de.hsadmin.module.property.mapping;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.common.error.UserException;
|
|
||||||
|
|
||||||
|
|
||||||
public class DefaultEnumPersistentObjectMapperTest {
|
|
||||||
|
|
||||||
|
|
||||||
private DefaultEnumPersistentObjectMapper mapper = new DefaultEnumPersistentObjectMapper();
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromPersistentObjectHavingEnum() throws TechnicalException, UserException {
|
|
||||||
SomeBO persistentObject = new SomeBO(SomeEnum.V1);
|
|
||||||
assertEquals( "V1", mapper.readValueFromPersistentObject(persistentObject, "someEnumProp"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void readValueFromPersistentObjectHavingString() throws TechnicalException, UserException {
|
|
||||||
SomeBO persistentObject = new SomeBO(SomeEnum.V2);
|
|
||||||
assertEquals( "V2", mapper.readValueFromPersistentObject(persistentObject, "someStringProp"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void writeValueToPersistentObject() throws TechnicalException, UserException {
|
|
||||||
SomeBO persistentObject = new SomeBO(SomeEnum.V3);
|
|
||||||
mapper.writeValueToPersistentObject(persistentObject, "someEnumProp", "V3");
|
|
||||||
assertEquals(SomeEnum.V3, persistentObject.getSomeEnumProp());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SomeBO {
|
|
||||||
|
|
||||||
private SomeEnum someEnumProp;
|
|
||||||
private String someStringProp;
|
|
||||||
|
|
||||||
public SomeBO(SomeEnum someProp) {
|
|
||||||
this.someEnumProp = someProp;
|
|
||||||
this.someStringProp = someProp.name();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SomeEnum getSomeEnumProp() {
|
|
||||||
return someEnumProp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSomeEnumProp(SomeEnum someProp) {
|
|
||||||
this.someEnumProp = someProp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSomeStringProp() {
|
|
||||||
return someStringProp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSomeStringProp(String someStringProp) {
|
|
||||||
this.someStringProp = someStringProp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static enum SomeEnum {
|
|
||||||
V1, V2, V3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
package de.hsadmin.service.property;
|
|
||||||
|
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import de.hsadmin.test.BaseRemoteTest;
|
|
||||||
|
|
||||||
@Ignore("there is no XmlRpcServlet.properties entry for this remote")
|
|
||||||
public class PropertyRemoteTest extends BaseRemoteTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void canInstantiateMemberShareServiceLocalViaRemoteRegistry() throws Exception {
|
|
||||||
givenRegisteredModuleLookupFor(PropertyServiceLocal.class);
|
|
||||||
whenServiceIsRetrievedFromRemoteRegistryKey("property");
|
|
||||||
thenModuleInstantiatesServiceOfClass(PropertyService.class);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,83 +0,0 @@
|
|||||||
package de.hsadmin.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import javax.ejb.Stateless;
|
|
||||||
import javax.naming.InitialContext;
|
|
||||||
import javax.naming.NamingException;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.mockito.Mockito;
|
|
||||||
import org.mockito.MockitoAnnotations;
|
|
||||||
import org.powermock.api.mockito.PowerMockito;
|
|
||||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
|
||||||
import org.powermock.modules.junit4.PowerMockRunner;
|
|
||||||
|
|
||||||
import de.hsadmin.common.error.TechnicalException;
|
|
||||||
import de.hsadmin.module.Module;
|
|
||||||
import de.hsadmin.module.ValueObject;
|
|
||||||
import de.hsadmin.xmlrpc.AbstractRemote;
|
|
||||||
|
|
||||||
@RunWith(PowerMockRunner.class)
|
|
||||||
@PrepareForTest({
|
|
||||||
AbstractRemote.class // to intercept `new InitialContext(...)`
|
|
||||||
})
|
|
||||||
public abstract class BaseRemoteTest {
|
|
||||||
private static final String RPC_SERVLET_PROPERTIES = "org/apache/xmlrpc/webserver/XmlRpcServlet.properties";
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private InitialContext context;
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private ValueObject valueObjectMock;
|
|
||||||
|
|
||||||
private String remoteClassName;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void init() throws Exception {
|
|
||||||
MockitoAnnotations.initMocks(this);
|
|
||||||
PowerMockito.whenNew(InitialContext.class).withArguments(Mockito.any(Hashtable.class)).thenReturn(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final InitialContext getInitialContext() {
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
protected final void givenRegisteredModuleLookupFor(final Class<? extends Module<? extends ValueObject>> moduleServiceInterface) throws NamingException, TechnicalException {
|
|
||||||
String moduleServiceName = moduleServiceInterface.getSimpleName(); // heuristic
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
Module<ValueObject> moduleService = (Module<ValueObject>) Mockito.mock(moduleServiceInterface);
|
|
||||||
Mockito.when(getInitialContext().lookup(moduleServiceName)).thenReturn(moduleService);
|
|
||||||
Mockito.when(moduleService.buildVO()).thenReturn(valueObjectMock);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final void whenServiceIsRetrievedFromRemoteRegistryKey(final String moduleId) throws IOException {
|
|
||||||
InputStream is = getClass().getClassLoader().getResourceAsStream(RPC_SERVLET_PROPERTIES);
|
|
||||||
assertNotNull(RPC_SERVLET_PROPERTIES + " not found or not readable", is);Properties props = new Properties();
|
|
||||||
|
|
||||||
props.load(is);
|
|
||||||
assertTrue(RPC_SERVLET_PROPERTIES + " does not contain " + moduleId, props.containsKey(moduleId));
|
|
||||||
|
|
||||||
remoteClassName = props.get(moduleId).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected final void thenModuleInstantiatesServiceOfClass(final Class<?> expectedModuleClass) throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException {
|
|
||||||
assertNotNull(expectedModuleClass + " is missing @" + Stateless.class.getSimpleName(), expectedModuleClass.getAnnotation(Stateless.class));
|
|
||||||
|
|
||||||
AbstractRemote<?> remote = (AbstractRemote<?>) getClass().getClassLoader().loadClass(remoteClassName).newInstance();
|
|
||||||
try {
|
|
||||||
ValueObject vo = remote.createValueObject();
|
|
||||||
assertNotNull(remoteClassName + ".createValueObject() returned null", vo);
|
|
||||||
} catch ( Exception exc ) {
|
|
||||||
fail("remote proxy " + remoteClassName + " not properly initialized: " + exc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
package de.hsadmin.test;
|
|
||||||
|
|
||||||
import org.hamcrest.Description;
|
|
||||||
import org.hamcrest.TypeSafeMatcher;
|
|
||||||
|
|
||||||
public class CauseMatcher extends TypeSafeMatcher<Throwable> {
|
|
||||||
|
|
||||||
private final Class<? extends Throwable> expectedExceptionTpe;
|
|
||||||
private final String expectedMessage;
|
|
||||||
|
|
||||||
public CauseMatcher(Class<? extends Throwable> expectedExceptionTpe, String expectedMessage) {
|
|
||||||
this.expectedExceptionTpe = expectedExceptionTpe;
|
|
||||||
this.expectedMessage = expectedMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean matchesSafely(final Throwable item) {
|
|
||||||
return item.getClass().isAssignableFrom(expectedExceptionTpe)
|
|
||||||
&& item.getMessage().contains(expectedMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void describeTo(final Description description) {
|
|
||||||
description
|
|
||||||
.appendText("expects exception of type ").appendValue(expectedExceptionTpe)
|
|
||||||
.appendText(" and with message ").appendValue(expectedMessage);
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>ldap-webapp</artifactId>
|
<artifactId>ldap-webapp</artifactId>
|
||||||
@ -16,54 +16,47 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>framework</artifactId>
|
<artifactId>framework</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>${hsadmin.version}</version>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>de.hsadmin</groupId>
|
|
||||||
<artifactId>framework</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<type>test-jar</type>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-jpa_2.0_spec</artifactId>
|
<artifactId>geronimo-jpa_2.2_spec</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-ejb_3.0_spec</artifactId>
|
<artifactId>geronimo-ejb_3.1_spec</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
<artifactId>geronimo-validation_1.0_spec</artifactId>
|
<artifactId>geronimo-validation_2.0_spec</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.bval</groupId>
|
<groupId>org.apache.bval</groupId>
|
||||||
<artifactId>org.apache.bval.bundle</artifactId>
|
<artifactId>org.apache.bval.bundle</artifactId>
|
||||||
<version>0.5</version>
|
<version>${bval.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.openjpa</groupId>
|
<groupId>org.apache.openjpa</groupId>
|
||||||
<artifactId>openjpa</artifactId>
|
<artifactId>openjpa</artifactId>
|
||||||
<version>2.4.2</version>
|
<version>${openjpa.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>${liquibase.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlrpc</groupId>
|
<groupId>org.apache.xmlrpc</groupId>
|
||||||
<artifactId>xmlrpc-server</artifactId>
|
<artifactId>xmlrpc-server</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>${xmlrpc.version}</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
@ -95,51 +88,20 @@
|
|||||||
<exclude>**/XmlRpcServlet.properties</exclude>
|
<exclude>**/XmlRpcServlet.properties</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-a-jar</id>
|
|
||||||
<phase>compile</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>build-helper-maven-plugin</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-artifacts</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>attach-artifact</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<artifacts>
|
|
||||||
<artifact>
|
|
||||||
<file>${project.basedir}/target/ldap-webapp-1.0-SNAPSHOT.jar</file>
|
|
||||||
<type>jar</type>
|
|
||||||
</artifact>
|
|
||||||
</artifacts>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.openejb.maven</groupId>
|
<groupId>org.apache.openejb.maven</groupId>
|
||||||
<artifactId>tomee-maven-plugin</artifactId>
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
<version>1.7.4</version>
|
<version>${tomee.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<tomeeVersion>1.7.4</tomeeVersion>
|
<tomeeVersion>${tomee.version}</tomeeVersion>
|
||||||
<tomeeClassifier>webprofile</tomeeClassifier>
|
<tomeeClassifier>webprofile</tomeeClassifier>
|
||||||
<debug>false</debug>
|
<debug>false</debug>
|
||||||
<debugPort>8000</debugPort>
|
<debugPort>8000</debugPort>
|
||||||
<context>ldap-webapp</context>
|
<context>ldap-webapp</context>
|
||||||
<config>${project.basedir}/src/test/tomee/conf</config>
|
<config>${project.basedir}/src/test/tomee/conf</config>
|
||||||
<libs>
|
<libs>
|
||||||
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
|
<lib>${postgresql.lib}</lib>
|
||||||
</libs>
|
</libs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
218
pom.xml
218
pom.xml
@ -1,179 +1,53 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
http://maven.apache.org/maven-v4_0_0.xsd">
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-parent</artifactId>
|
<artifactId>hsadmin-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0.1</version>
|
||||||
<name>HSAdmin Parent Project</name>
|
<name>HSAdmin Parent Project</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- no idea how to exclude the methods generated by OpenJPA enhancer from JaCoCo :-( -->
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<jacoco.check.lineRatio>0.0</jacoco.check.lineRatio>
|
<hsadmin.version>1.0.1</hsadmin.version>
|
||||||
<jacoco.check.branchRatio>0.0</jacoco.check.branchRatio>
|
<tomee.version>8.0.4</tomee.version>
|
||||||
<jacoco.check.complexityMax>25</jacoco.check.complexityMax>
|
<servlet.version>4.0.1</servlet.version>
|
||||||
</properties>
|
<liquibase.version>4.1.1</liquibase.version>
|
||||||
|
<openjpa.version>3.1.2</openjpa.version>
|
||||||
<modules>
|
<log4j.version>1.2.17</log4j.version>
|
||||||
<module>db-migration</module>
|
<xmlrpc.version>3.1.3</xmlrpc.version>
|
||||||
<module>framework</module>
|
<bval.version>2.0.4</bval.version>
|
||||||
<module>cust-services</module>
|
<postgresql.lib>org.postgresql:postgresql:42.2.18</postgresql.lib>
|
||||||
<module>ldap-services</module>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<module>database-services</module>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<module>web</module>
|
</properties>
|
||||||
<module>cli</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<build>
|
<modules>
|
||||||
<pluginManagement>
|
<module>db-migration</module>
|
||||||
<plugins>
|
<module>framework</module>
|
||||||
<plugin>
|
<module>cust-services</module>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<module>ldap-services</module>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<!--
|
||||||
<configuration>
|
<module>database-services</module>
|
||||||
<source>1.7</source>
|
-->
|
||||||
<target>1.7</target>
|
<module>web</module>
|
||||||
<downloadSources>true</downloadSources>
|
<module>cli</module>
|
||||||
<downloadJavadocs>true</downloadJavadocs>
|
</modules>
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.19.1</version>
|
|
||||||
<configuration>
|
|
||||||
<argLine>${argLine} -XX:+AlwaysLockClassLoader</argLine>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.jacoco</groupId>
|
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
|
||||||
<version>0.7.9</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>default-prepare-agent</id>
|
|
||||||
<goals>
|
|
||||||
<goal>prepare-agent</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>default-report</id>
|
|
||||||
<phase>prepare-package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>report</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
|
||||||
<id>default-check</id>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<rules>
|
|
||||||
<rule>
|
|
||||||
<element>BUNDLE</element>
|
|
||||||
<limits>
|
|
||||||
<limit>
|
|
||||||
<counter>LINE</counter>
|
|
||||||
<value>COVEREDRATIO</value>
|
|
||||||
<minimum>${jacoco.check.lineRatio}</minimum>
|
|
||||||
</limit>
|
|
||||||
<limit>
|
|
||||||
<counter>BRANCH</counter>
|
|
||||||
<value>COVEREDRATIO</value>
|
|
||||||
<minimum>${jacoco.check.branchRatio}</minimum>
|
|
||||||
</limit>
|
|
||||||
</limits>
|
|
||||||
</rule>
|
|
||||||
<rule>
|
|
||||||
<element>METHOD</element>
|
|
||||||
<limits>
|
|
||||||
<limit>
|
|
||||||
<counter>COMPLEXITY</counter>
|
|
||||||
<value>TOTALCOUNT</value>
|
|
||||||
<maximum>${jacoco.check.complexityMax}</maximum>
|
|
||||||
</limit>
|
|
||||||
</limits>
|
|
||||||
</rule>
|
|
||||||
</rules>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.11</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.12</version>
|
<version>4.13.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
</dependencies>
|
||||||
<groupId>org.mockito</groupId>
|
|
||||||
<artifactId>mockito-all</artifactId>
|
|
||||||
<version>1.10.19</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.powermock</groupId>
|
|
||||||
<artifactId>powermock-module-junit4</artifactId>
|
|
||||||
<version>1.6.6</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.powermock</groupId>
|
|
||||||
<artifactId>powermock-api-mockito</artifactId>
|
|
||||||
<version>1.6.6</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.openpojo</groupId>
|
|
||||||
<artifactId>openpojo</artifactId>
|
|
||||||
<version>0.8.4</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>pl.pragmatists</groupId>
|
|
||||||
<artifactId>JUnitParams</artifactId>
|
|
||||||
<version>1.0.4</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>Windows</id>
|
|
||||||
<activation>
|
|
||||||
<os>
|
|
||||||
<family>Windows</family>
|
|
||||||
</os>
|
|
||||||
</activation>
|
|
||||||
<properties>
|
|
||||||
<script.extension>bat</script.extension>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
<profile>
|
|
||||||
<id>unix</id>
|
|
||||||
<activation>
|
|
||||||
<os>
|
|
||||||
<family>unix</family>
|
|
||||||
</os>
|
|
||||||
</activation>
|
|
||||||
<properties>
|
|
||||||
<script.extension>sh</script.extension>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
Loading…
Reference in New Issue
Block a user