<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements. See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership. The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License. You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied. See the License for the
    specific language governing permissions and limitations
    under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.apache.qpid</groupId>
    <artifactId>qpid-skimtests</artifactId>
    <packaging>jar</packaging>
    <version>1.0-incubating-M2.1-SNAPSHOT</version>
    <name>Qpid Skim Tests</name>
    <url>http://cwiki.apache.org/confluence/display/qpid</url>

    <parent>
        <groupId>org.apache.qpid</groupId>
        <artifactId>qpid</artifactId>
        <version>1.0-incubating-M2.1-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <topDirectoryLocation>..</topDirectoryLocation>
        <log4j.perftests>perftests.log4j</log4j.perftests>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>qpid-perftests</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>qpid-client</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>qpid-broker</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>qpid-broker</artifactId>
            <version>1.0-incubating-M2.1-SNAPSHOT</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>qpid-systests</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.qpid</groupId>
            <artifactId>junit-toolkit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId> 
            <artifactId>slf4j-log4j12</artifactId>  
            <version>1.4.0</version>  
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.qpid</groupId>
                <artifactId>junit-toolkit-maven-plugin</artifactId>

                <configuration>
                    <scriptOutDirectory>target</scriptOutDirectory>
                    <testJar>${project.build.finalName}.jar</testJar>
                    <systemproperties>
                        <property>
                            <name>-Xms</name>
                            <value>256m</value>
                        </property>
                        <property>
                            <name>-Xmx</name>
                            <value>1024m</value>
                        </property>
                        <property>
                            <name>log4j.configuration</name>
                            <value>${log4j.perftests}</value>
                        </property>
                        <property>
                            <name>amqj.logging.level</name>
                            <value>warn</value>
                        </property>
                        <property>
                            <name>badger.level</name>
                            <value>warn</value>
                        </property>
                        <property>
                            <name>amqj.test.logging.level</name>
                            <value>info</value>
                        </property>
                    </systemproperties>

                    <commands>
                        <!-- Benchmarking tests for throughput. -->
                        <TQBT-TX-Qpid-01>-n TQBT-TX-Qpid-01   -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=false pubsub=false uniqueDests=true  numConsumers=1   transacted=true  consTransacted=true  consAckMode=0   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </TQBT-TX-Qpid-01>
                        <TQBT-AA-Qpid-01>-n TQBT-AA-Qpid-01   -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=false pubsub=false uniqueDests=true  numConsumers=1   transacted=false consTransacted=false consAckMode=1   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </TQBT-AA-Qpid-01>
                        <TQBT-NA-Qpid-01>-n TQBT-NA-Qpid-01   -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=false pubsub=false uniqueDests=true  numConsumers=1   transacted=false consTransacted=false consAckMode=257 commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </TQBT-NA-Qpid-01>
                        <TTBT-TX-Qpid-01>-n TTBT-TX-Qpid-01   -d1M -s[1000] -c[2]  -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=false pubsub=true  uniqueDests=false numConsumers=8   transacted=true  consTransacted=false consAckMode=1   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </TTBT-TX-Qpid-01>
                        <TTBT-AA-Qpid-01>-n TTBT-AA-Qpid-01   -d1M -s[1000] -c[2]  -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=false pubsub=true  uniqueDests=false numConsumers=8   transacted=false consTransacted=false consAckMode=1   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </TTBT-AA-Qpid-01>
                        <TTBT-NA-Qpid-01>-n TTBT-NA-Qpid-01   -d1M -s[1000] -c[2]  -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=false pubsub=true  uniqueDests=false numConsumers=8   transacted=false consTransacted=false consAckMode=257 commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </TTBT-NA-Qpid-01>

                        <!-- Leave the persistent ones out for the moment, need to include the file store and decide where to put it too.
                             <PQBT-TX-Qpid-01>-n PQBT-TX-Qpid-01   -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=true  pubsub=false uniqueDests=true  numConsumers=1   transacted=true  consTransacted=true  consAckMode=0   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </PQBT-TX-Qpid-01>
                             <PQBT-AA-Qpid-01>-n PQBT-AA-Qpid-01   -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=true  pubsub=false uniqueDests=true  numConsumers=1   transacted=false consTransacted=false consAckMode=1   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </PQBT-AA-Qpid-01>
                             <PTBT-TX-Qpid-01>-n PTBT-TX-Qpid-01   -d1M -s[1000] -c[2]  -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=true  pubsub=true  uniqueDests=false numConsumers=8   transacted=true  consTransacted=false consAckMode=1   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </PTBT-TX-Qpid-01>
                             <PTBT-AA-Qpid-01>-n PTBT-AA-Qpid-01   -d1M -s[1000] -c[2]  -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf   persistent=true  pubsub=true  uniqueDests=false numConsumers=8   transacted=false consTransacted=false consAckMode=1   commitBatchSize=1   batchSize=1000   messageSize=256     destinationCount=1  rate=0     maxPending=2000000 </PTBT-AA-Qpid-01>
                        -->
                    </commands>
                </configuration>

                <executions>         
                    <execution>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>${antrun.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>ant</groupId>
                        <artifactId>ant-nodeps</artifactId>
                        <version>1.6.5</version>
                    </dependency>
                </dependencies>

                <executions>
                    <execution>
                        <id>skim_test</id>
                        <phase>test</phase>
                        <configuration>
                            <tasks>
                                <mkdir dir="target/skim-test-results"/>

                                <property name="command" 
                                          value="find target/ -name '*Qpid-01.sh' -exec -o target/skim-test-results {} \;"/>

                                <java classname="org.apache.qpid.server.RunBrokerWithCommand" fork="true" failonerror="true">
                                    <arg value="${command}"/>
                                    <arg value="-p"/>
                                    <arg value="2110"/>
                                    <arg value="-m"/>
                                    <arg value="2111"/>
                                    
                                    <classpath refid="maven.test.classpath"/>
                                    <sysproperty key="QPID_HOME" value="../broker"/>
                                    <sysproperty key="QPID_WORK" value="target/"/>
                                </java>

                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>

</project>
