diff options
author | Martin Ritchie <ritchiem@apache.org> | 2007-01-12 01:03:21 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2007-01-12 01:03:21 +0000 |
commit | 7d02021e1405afa249b3f9c6427b3a6ea7095d15 (patch) | |
tree | 1e06e7776c7a4bb2838ad2495579ad24bc4a503f | |
parent | 9eef1e1f7ddc4c4ace42c3edbc3fa9db1e509666 (diff) | |
download | qpid-python-7d02021e1405afa249b3f9c6427b3a6ea7095d15.tar.gz |
QPID-146 QPID-112 QPID-278
Summary
Reworked a lot of the distribution work done by the build system.
This ended up with me creating a reduced client distribution (hope that is ok Steve)
Each module now has has a distribution directory (except common it may need a tests build later) This will build the individual components in to a distribution binary only, binary with tests and source.
To build the binary with tests in the distribution directory use profile tests so $mvn -Ptests
In all cases the dependencies have been reduced and correctly assigned to the correct scope.
There were a couple of cases where a runtime dependency of one of our dependencies didn't make it in to the distributions so they were added explicitly. This should be looked at again.
Specifics
Broker:
Three new assembly files are located in the distribution/src directory (broker-bin taking heavily from distribution - bin) these generate the three distributions.
SimpleFilterManager.java removed slf4j reference
broker/test directory removed as it was left over from the ant system
Client:
Added intelij files to ignore list.
client/dist deleted as it was left over from the ant system
client/distribution as for the broker three assemblies matching the three distributions
Renamed log4j.properties to client.log4j to prevent issues when it is packaged into the jar.
Removed old_test ping and requestreply1 as they have been moved to perftests
Moved broker back to a test dependency. This required modifying AMQSession.java to remove reference to ExchangeBoundHandler.java
Common:
Added more common dependencies from broker and client here.
Distribution:
Reduced the assemblies to only build the full project binary, binary with tests and source.
Perftests:
Added building of perftests distribution so this can be bundled separately.
Resources:
Moved Resources from distribution project to root level this allows them to be easily incorporated in all projects.
Systests:
as with perftests now builds a separate distribution that can be used on an existing installation.
renamed log4j.properties to systests.log4j to prevent logging problems.
As systests is a module having the code under the test folder isn't accurate as it is the main code. Test code here should be testing the tests :D !!
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@495455 13f79535-47bb-0310-9956-ffa450edef68
70 files changed, 2040 insertions, 1496 deletions
diff --git a/java/broker/distribution/pom.xml b/java/broker/distribution/pom.xml new file mode 100644 index 0000000000..e16ac35e07 --- /dev/null +++ b/java/broker/distribution/pom.xml @@ -0,0 +1,150 @@ +<!-- + 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-broker-distribution</artifactId> + <packaging>jar</packaging> + <version>1.0-incubating-M2-SNAPSHOT</version> + <name>Qpid Broker Distributions</name> + <url>http://cwiki.apache.org/confluence/display/qpid</url> + + <parent> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid</artifactId> + <version>1.0-incubating-M2-SNAPSHOT</version> + </parent> + + <properties> + <topDirectoryLocation>..</topDirectoryLocation> + <java.source.version>1.5</java.source.version> + <qpid.version>${pom.version}</qpid.version> + <qpid.targetDir>${project.build.directory}</qpid.targetDir> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-broker</artifactId> + <type>jar</type> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>${java.source.version}</source> + <target>${java.source.version}</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>${assembly.version}</version> + <configuration> + <finalName>qpid-${pom.version}</finalName> + <outputDirectory>${qpid.targetDir}</outputDirectory> + <tarLongFileMode>gnu</tarLongFileMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <finalName>qpid-incubating</finalName> + <archive> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + </archive> + </configuration> + </plugin> + + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/broker-bin.xml</descriptor> + <descriptor>src/main/assembly/broker-src.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + + <profiles> + <profile> + <id>tests</id> + + <dependencies> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-broker</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/broker-bin-tests.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + </profile> + </profiles> +</project> diff --git a/java/broker/distribution/src/main/assembly/broker-bin-tests.xml b/java/broker/distribution/src/main/assembly/broker-bin-tests.xml new file mode 100644 index 0000000000..fa017d6232 --- /dev/null +++ b/java/broker/distribution/src/main/assembly/broker-bin-tests.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <id>java-broker-bin-with-tests</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + + <fileSets> + <fileSet> + <!-- Apache license files --> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + + <fileSet> + <directory>../../release-docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + + <!-- Include easy access to test source--> + <fileSet> + <directory>../src/test</directory> + <outputDirectory>qpid-${qpid.version}/src</outputDirectory> + <includes> + <include>**/*.java</include> + </includes> + </fileSet> + + <!-- Execution Scripts --> + <fileSet> + <directory>../bin/</directory> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <includes> + <include>**/*</include> + </includes> + <fileMode>777</fileMode> <!-- RWX --> + </fileSet> + + <!-- Configuration --> + <fileSet> + <directory>../etc/</directory> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <includes> + <include>**/*</include> + </includes> + <fileMode>420</fileMode> + </fileSet> + + <!-- Metadata Jar --> + <fileSet> + <directory>target</directory> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <includes> + <include>qpid-incubating.jar</include> + </includes> + </fileSet> + </fileSets> + + + <files> + <!-- Common Run scripts --> + <file> + <source>../../common/bin/qpid-run</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-run</destName> + <fileMode>493</fileMode> + </file> + + <!-- Common Configuration --> + <file> + <source>../../common/etc/qpid-run.conf</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>qpid-run.conf</destName> + <fileMode>420</fileMode> + </file> + </files> + + <dependencySets> + <dependencySet> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <unpack>false</unpack> + <excludes> + <exclude>org.apache.qpid:qpid-broker-distribution</exclude> + </excludes> + </dependencySet> + </dependencySets> +</assembly> diff --git a/java/broker/distribution/src/main/assembly/broker-bin.xml b/java/broker/distribution/src/main/assembly/broker-bin.xml new file mode 100644 index 0000000000..e64685fc79 --- /dev/null +++ b/java/broker/distribution/src/main/assembly/broker-bin.xml @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <!-- id typically identifies the "type" (src vs bin etc) of the assembly --> + <id>java-broker-bin</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + + <fileSets> + <!-- Apache Licensing --> + <fileSet> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>../..</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>*.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>../../src/main/release-docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + + <!-- Metadata Jar --> + <fileSet> + <directory>target</directory> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <includes> + <include>qpid-incubating.jar</include> + </includes> + </fileSet> + </fileSets> + <files> + <!-- due to a bug in the assembly plugin (MASSEMBLY-153) you have + to use decimal numbers to specify fileMode --> + <file> + <source>../../common/etc/qpid-run.conf</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>qpid-run.conf</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../etc/config.xml</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>config.xml</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../etc/log4j.xml</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>log4j.xml</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../etc/passwd</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>passwd</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../etc/qpid-server.conf</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>qpid-server.conf</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../etc/virtualhosts.xml</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>virtualhosts.xml</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../../common/bin/qpid-run</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-run</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../bin/qpid-server</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-server</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../bin/qpid-server.bat</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-server.bat</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../bin/run.bat</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>run.bat</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../bin/run.sh</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>run.sh</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../bin/runAll</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>runAll</destName> + <fileMode>493</fileMode> + </file> + </files> + + <dependencySets> + <dependencySet> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <unpack>false</unpack> + <!-- This needs to be tidied up QPID-280 --> + <excludes> + <exclude>org.apache.qpid:qpid-broker-distribution</exclude> + <exclude>org.apache.qpid.management:org.apache.qpid.management.ui</exclude> + <exclude>org.eclipse.core:org.eclipse.core.commands</exclude> + <exclude>org.eclipse.core:org.eclipse.core.contenttype</exclude> + <exclude>org.eclipse.core:org.eclipse.core.expressions</exclude> + <exclude>org.eclipse.core:org.eclipse.core.jobs</exclude> + <exclude>org.eclipse.core:org.eclipse.core.runtime</exclude> + <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.auth</exclude> + <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude> + <exclude>org.eclipse.equinox:org.eclipse.equinox.common</exclude> + <exclude>org.eclipse.equinox:org.eclipse.equinox.preferences</exclude> + <exclude>org.eclipse.equinox:org.eclipse.equinox.registry</exclude> + <exclude>org.eclipse.help:org.eclipse.help</exclude> + <exclude>org.eclipse.jface:org.eclipse.jface</exclude> + <exclude>org.eclipse.osgi:org.eclipse.osgi</exclude> + <exclude>org.eclipse.swt:org.eclipse.swt</exclude> + <exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86</exclude> + <exclude>org.eclipse.ui:org.eclipse.ui</exclude> + <exclude>org.eclipse.ui:org.eclipse.ui.forms</exclude> + <exclude>org.eclipse.ui:org.eclipse.ui.workbench</exclude> + </excludes> + </dependencySet> + </dependencySets> +</assembly> diff --git a/java/broker/distribution/src/main/assembly/broker-src.xml b/java/broker/distribution/src/main/assembly/broker-src.xml new file mode 100644 index 0000000000..28a22c3851 --- /dev/null +++ b/java/broker/distribution/src/main/assembly/broker-src.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <!-- id typically identifies the "type" (src vs bin etc) of the assembly --> + <id>java-broker-src</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + + <fileSets> + <!-- Apache Licensing --> + <fileSet> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}-src</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>licenses/*.*</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + <include>BUILDING.txt</include> + </includes> + </fileSet> + <!-- Broker source --> + <fileSet> + <directory>..</directory> + <outputDirectory>qpid-${qpid.version}-src</outputDirectory> + <includes> + <include>**/*</include> + </includes> + <!-- Tidy up wrt to QPID-280 --> + <excludes> + <exclude>build.xml</exclude> + <exclude>distribution/build.xml</exclude> + <exclude>benchmark</exclude> + <exclude>benchmark/**/*</exclude> + <exclude>**/target</exclude> + <exclude>**/target/**/*</exclude> + <exclude>**/build</exclude> + <exclude>**/build/**/*</exclude> + <exclude>**/.settings</exclude> + <exclude>**/.classpath</exclude> + <exclude>**/.project</exclude> + <exclude>**/.wtpmodules</exclude> + <exclude>**/surefire*</exclude> + <exclude>**/cobertura.ser</exclude> + <exclude>bin</exclude> + <exclude>bin/*</exclude> + <exclude>lib</exclude> + <exclude>lib/**/*</exclude> + <exclude>**/var/journal</exclude> + <exclude>**/build.out*</exclude> + <exclude>**/eclipse-plugin/bin/**</exclude> + <exclude>**/eclipse-plugin/plugins/**</exclude> + <exclude>**/eclipse-plugin/src/main/resources/**</exclude> + </excludes> + </fileSet> + </fileSets> +</assembly> diff --git a/java/broker/pom.xml b/java/broker/pom.xml index 48883b7912..dd6a2279da 100644 --- a/java/broker/pom.xml +++ b/java/broker/pom.xml @@ -41,49 +41,51 @@ <groupId>org.apache.qpid</groupId> <artifactId>qpid-common</artifactId> </dependency> + <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> </dependency> + <dependency> <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> </dependency> + <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> </dependency> - <dependency> - <groupId>org.apache.geronimo.specs</groupId> - <artifactId>geronimo-jms_1.1_spec</artifactId> - </dependency> - <dependency> - <groupId>org.apache.mina</groupId> - <artifactId>mina-filter-ssl</artifactId> - </dependency> - <dependency> - <groupId>org.apache.mina</groupId> - <artifactId>mina-java5</artifactId> - </dependency> - <dependency> - <groupId>backport-util-concurrent</groupId> - <artifactId>backport-util-concurrent</artifactId> - </dependency> - <dependency> + +<!-- This is a mina dependency but it isn't being picked up--> + <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> - </dependency> + </dependency> + + +<!-- Test Dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> + <scope>test</scope> </dependency> + <dependency> <groupId>org.easymock</groupId> <artifactId>easymockclassextension</artifactId> + <scope>test</scope> </dependency> </dependencies> <build> + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -128,20 +130,32 @@ </systemProperties> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> - <id>bundle-test-jar</id> <phase>package</phase> <goals> <goal>test-jar</goal> </goals> </execution> - </executions> + </executions> </plugin> </plugins> + + <testResources> + <testResource> + <targetPath>src/</targetPath> + <filtering>false</filtering> + <directory>src/test/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </testResource> + </testResources> + </build> </project> diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java b/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java index dc2c2c0e6c..9065551697 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java +++ b/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java @@ -21,15 +21,14 @@ package org.apache.qpid.server.filter; import org.apache.qpid.server.queue.AMQMessage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.log4j.Logger; import javax.jms.JMSException; import java.util.concurrent.ConcurrentLinkedQueue; public class SimpleFilterManager implements FilterManager { - private final Logger _logger = LoggerFactory.getLogger(SimpleFilterManager.class); + private final Logger _logger = Logger.getLogger(SimpleFilterManager.class); private final ConcurrentLinkedQueue<MessageFilter> _filters; diff --git a/java/broker/test/lib/README b/java/broker/test/lib/README deleted file mode 100644 index aa57bb004b..0000000000 --- a/java/broker/test/lib/README +++ /dev/null @@ -1 +0,0 @@ -Junit copied here momentarily. diff --git a/java/broker/test/lib/junit/junit-4.0.jar b/java/broker/test/lib/junit/junit-4.0.jar Binary files differdeleted file mode 100644 index b20406924a..0000000000 --- a/java/broker/test/lib/junit/junit-4.0.jar +++ /dev/null diff --git a/java/broker/test/lib/junit/junit.jar b/java/broker/test/lib/junit/junit.jar Binary files differdeleted file mode 100644 index 674d71e89e..0000000000 --- a/java/broker/test/lib/junit/junit.jar +++ /dev/null diff --git a/java/client/dist/readme.txt b/java/client/dist/readme.txt deleted file mode 100644 index b5f7b107b6..0000000000 --- a/java/client/dist/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory is deliberately empty. -AMQP JAR files will be built here during the build process. diff --git a/java/client/distribution/pom.xml b/java/client/distribution/pom.xml new file mode 100644 index 0000000000..dfbe8b83c2 --- /dev/null +++ b/java/client/distribution/pom.xml @@ -0,0 +1,155 @@ +<!-- + 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-client-distribution</artifactId> + <packaging>jar</packaging> + <version>1.0-incubating-M2-SNAPSHOT</version> + <name>Qpid Client Distributions</name> + <url>http://cwiki.apache.org/confluence/display/qpid</url> + + <parent> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid</artifactId> + <version>1.0-incubating-M2-SNAPSHOT</version> + </parent> + + <properties> + <topDirectoryLocation>..</topDirectoryLocation> + <java.source.version>1.5</java.source.version> + <qpid.version>${pom.version}</qpid.version> + <qpid.targetDir>${project.build.directory}</qpid.targetDir> + <qpid.root>${basedir}/..</qpid.root> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-client</artifactId> + <type>jar</type> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>${java.source.version}</source> + <target>${java.source.version}</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>${assembly.version}</version> + <configuration> + <descriptors> + <descriptor>src/main/assembly/client-bin.xml</descriptor> + </descriptors> + <finalName>qpid-${pom.version}</finalName> + <outputDirectory>${qpid.targetDir}</outputDirectory> + <tarLongFileMode>gnu</tarLongFileMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <finalName>qpid-incubating</finalName> + <archive> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + </archive> + </configuration> + </plugin> + + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/client-bin.xml</descriptor> + <descriptor>src/main/assembly/client-src.xml</descriptor> + </descriptors> + <finalName>qpid-${pom.version}</finalName> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + +<profiles> + <profile> + <id>tests</id> + + <dependencies> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-client</artifactId> + <type>test-jar</type> + <version>${project.version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/client-bin-tests.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> +</profiles> + +</project> diff --git a/java/distribution/src/main/assembly/client-bin.xml b/java/client/distribution/src/main/assembly/client-bin-tests.xml index b9e9939c95..ec4df1c9a7 100644 --- a/java/distribution/src/main/assembly/client-bin.xml +++ b/java/client/distribution/src/main/assembly/client-bin-tests.xml @@ -18,28 +18,17 @@ * under the License. --> <assembly> - <id>java-client-bin</id> + <id>java-client-bin-with-tests</id> <includeBaseDirectory>false</includeBaseDirectory> <formats> <format>tar.gz</format> <format>zip</format> </formats> - <moduleSets> - <moduleSet> - <includes> - <include>org.apache.qpid:client</include> - </includes> - <binaries> - <includeDependencies>true</includeDependencies> - <unpack>false</unpack> - </binaries> - </moduleSet> - </moduleSets> - <fileSets> <fileSet> - <directory>src/main/release</directory> + <!-- Apache license files --> + <directory>../../resources</directory> <outputDirectory>qpid-${qpid.version}</outputDirectory> <includes> <include>DISCLAIMER</include> @@ -48,28 +37,55 @@ <include>README.txt</include> </includes> </fileSet> + <fileSet> + <directory>../../release-docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + + <!-- Include easy access to test source--> + <fileSet> + <directory>../src/test</directory> + <outputDirectory>qpid-${qpid.version}/src</outputDirectory> + <includes> + <include>**/*.java</include> + </includes> + </fileSet> + + <!-- fileSet> Client contains a readme.txt as does qpid root. + Which will cause problems on windows as the zip will + contain: readme.txt and README.txt + < Client local documentation> <directory>..</directory> <outputDirectory>qpid-${qpid.version}</outputDirectory> <includes> <include>*.txt</include> </includes> - </fileSet> - <fileSet> - <directory>src/main/release/etc</directory> + </fileSet--> + + <!-- Configuration --> + <fileSet> + <directory>../test/etc</directory> <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> <includes> - <include>logging.properties</include> - <include>log4j.properties</include> + <include>**/*</include> </includes> - </fileSet> - <fileSet> - <directory>src/main/release/docs</directory> - <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + </fileSet> + + <!-- Execution Scripts --> + <fileSet> + <directory>../test/bin</directory> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> <includes> - <include>RELEASE_NOTES.txt</include> + <include>**/*</include> </includes> - </fileSet> + <fileMode>777</fileMode> <!-- RWX --> + </fileSet> + + <!-- Metadata Jar --> <fileSet> <directory>target</directory> <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> @@ -83,29 +99,9 @@ <dependencySet> <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> <unpack>false</unpack> - <excludes> - <exclude>org.apache.qpid:qpid-distribution</exclude> - <exclude>org.apache.qpid.management:org.apache.qpid.management.ui</exclude> - <exclude>org.eclipse.core:org.eclipse.core.commands</exclude> - <exclude>org.eclipse.core:org.eclipse.core.contenttype</exclude> - <exclude>org.eclipse.core:org.eclipse.core.expressions</exclude> - <exclude>org.eclipse.core:org.eclipse.core.jobs</exclude> - <exclude>org.eclipse.core:org.eclipse.core.runtime</exclude> - <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.auth</exclude> - <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude> - <exclude>org.eclipse.equinox:org.eclipse.equinox.common</exclude> - <exclude>org.eclipse.equinox:org.eclipse.equinox.preferences</exclude> - <exclude>org.eclipse.equinox:org.eclipse.equinox.registry</exclude> - <exclude>org.eclipse.help:org.eclipse.help</exclude> - <exclude>org.eclipse.jface:org.eclipse.jface</exclude> - <exclude>org.eclipse.osgi:org.eclipse.osgi</exclude> - <exclude>org.eclipse.swt:org.eclipse.swt</exclude> - <exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86</exclude> - <exclude>org.eclipse.ui:org.eclipse.ui</exclude> - <exclude>org.eclipse.ui:org.eclipse.ui.forms</exclude> - <exclude>org.eclipse.ui:org.eclipse.ui.workbench</exclude> + <excludes> + <exclude>org.apache.qpid:qpid-client-distribution</exclude> </excludes> - <scope>runtime</scope> </dependencySet> </dependencySets> </assembly> diff --git a/java/client/distribution/src/main/assembly/client-bin.xml b/java/client/distribution/src/main/assembly/client-bin.xml new file mode 100644 index 0000000000..962f084995 --- /dev/null +++ b/java/client/distribution/src/main/assembly/client-bin.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <id>java-client-bin</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + + <fileSets> + <fileSet> + <!-- Apache license files --> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + + <!--fileSet> + < Client local documentation> + <directory>..</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>*.txt</include> + </includes> + </fileSet--> + + <fileSet> + <directory>../../release-docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + + <fileSet> + <directory>target</directory> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <includes> + <include>qpid-incubating.jar</include> + </includes> + </fileSet> + </fileSets> + + <dependencySets> + <dependencySet> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <unpack>false</unpack> + <excludes> + <exclude>org.apache.qpid:qpid-client-distribution</exclude> + </excludes> + </dependencySet> + </dependencySets> +</assembly> diff --git a/java/distribution/src/main/assembly/tests.xml b/java/client/distribution/src/main/assembly/client-src.xml index bde542fc92..b5055f05d7 100644 --- a/java/distribution/src/main/assembly/tests.xml +++ b/java/client/distribution/src/main/assembly/client-src.xml @@ -18,40 +18,45 @@ * under the License. --> <assembly> - <id>java-tests</id> + <!-- id typically identifies the "type" (src vs bin etc) of the assembly --> + <id>java-client-src</id> <includeBaseDirectory>false</includeBaseDirectory> <formats> <format>tar.gz</format> <format>zip</format> </formats> - + <fileSets> + + <fileSet> + <!-- Apache license files --> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}-src</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + <fileSet> - <directory>../broker/target</directory> - <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> - <includes> - <include>*-tests.jar</include> - </includes> - </fileSet> - <fileSet> - <directory>../client/target</directory> - <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <directory>..</directory> + <outputDirectory>qpid-${qpid.version}-src</outputDirectory> <includes> - <include>*-tests.jar</include> + <include>src/main/**</include> + <include>src/test/**</include> + <include>test/main/**</include> + <include>test/test/**</include> + <include>pom.xml</include> + <include>distribution/**</include> </includes> + <excludes> + <exclude>**/target</exclude> + <exclude>**/target/**/*</exclude> + <exclude>**/build</exclude> + <exclude>**/build/**/*</exclude> + </excludes> </fileSet> </fileSets> - - <dependencySets> - <dependencySet> - <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> - <unpack>false</unpack> - <includes> - <include>org.apache.qpid:qpid-systests</include> - <include>org.apache.qpid:qpid-perftests</include> - </includes> - <scope>test</scope> - </dependencySet> - </dependencySets> - </assembly> diff --git a/java/client/pom.xml b/java/client/pom.xml index 47ac2cb583..35f5224a67 100644 --- a/java/client/pom.xml +++ b/java/client/pom.xml @@ -35,40 +35,51 @@ <properties> <topDirectoryLocation>..</topDirectoryLocation> + <java.source.version>1.5</java.source.version> + <qpid.version>${pom.version}</qpid.version> + <qpid.targetDir>${project.build.directory}</qpid.targetDir> </properties> <dependencies> + <dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-common</artifactId> </dependency> - <dependency> - <groupId>org.apache.qpid</groupId> - <artifactId>qpid-broker</artifactId> - </dependency> - - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jms_1.1_spec</artifactId> </dependency> + <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> + <exclusions> <!-- Tries to download 1.2.7--> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> </dependency> + <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> </dependency> + <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-filter-ssl</artifactId> </dependency> +<!-- Test Dependencies --> + <dependency> <!-- for inVm Broker --> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-broker</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>jmscts</groupId> <artifactId>jmscts</artifactId> @@ -85,12 +96,14 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> + <scope>test</scope> </dependency> + <dependency> <groupId>org.easymock</groupId> <artifactId>easymockclassextension</artifactId> + <scope>test</scope> </dependency> - </dependencies> <build> @@ -115,24 +128,67 @@ </property> <property> <name>log4j.configuration</name> - <value>file:///${basedir}/src/main/java/log4j.properties</value> + <value>file:///${basedir}/src/main/java/client.log4j</value> </property> </systemProperties> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> - <id>bundle-test-jar</id> <phase>package</phase> <goals> <goal>test-jar</goal> </goals> </execution> - </executions> + </executions> </plugin> + </plugins> + +<!-- The inclusion of this resource causes the build to hang. --> + <!--resources> + <resource> + <targetPath>META-INF/</targetPath> + <filtering>false</filtering> + <directory>../resources/META-INF</directory> + <includes> + <include>**</include> + </includes> + </resource> + </resources--> + + <testResources> + <testResource> + <targetPath>META-INF/</targetPath> + <filtering>false</filtering> + <directory>../resources/META-INF</directory> + <includes> + <include>**</include> + </includes> + </testResource> + <testResource> + <targetPath>src/</targetPath> + <filtering>false</filtering> + <directory>src/test/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </testResource> + + <testResource> + <targetPath></targetPath> + <filtering>false</filtering> + <directory>src/main/java</directory> + <includes> + <include>client.log4j</include> + </includes> + </testResource> + </testResources> + </build> + </project> diff --git a/java/client/readme.txt b/java/client/readme.txt deleted file mode 100644 index ef8fa01717..0000000000 --- a/java/client/readme.txt +++ /dev/null @@ -1,31 +0,0 @@ -AMQP JMS API - -To build this you will need ant. The build.xml file requires that the amq.home -property be set to point to the location of the root directory under which the -base2 and amqp moduels reside (these contain protocol definitions used in -the code generation). - -You can avoid setting it if you have the following structure: - - root/ - base/ - base2/ - foreign/ - gsl/ - amqp/ - blaze/ - java/ - client - build.xml - Readme.txt [this file] - common - - -Otherwise you can either pass it in on the command line or add it to a file -named build.properties in the same directory as this Readme.txt file. - -E.g.: - -ant -Damq.home=c:\AMQP\ - - diff --git a/java/systests/src/test/java/log4j.properties b/java/client/src/main/java/client.log4j index 6d596d1d19..525433e9a9 100644 --- a/java/systests/src/test/java/log4j.properties +++ b/java/client/src/main/java/client.log4j @@ -1,28 +1,28 @@ -# -# 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. -# -log4j.rootLogger=${root.logging.level} - - -log4j.logger.org.apache.qpid=${amqj.logging.level}, console -log4j.additivity.org.apache.qpid=false - -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.Threshold=all -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n +#
+# 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.
+#
+log4j.rootLogger=${root.logging.level}
+
+
+log4j.logger.org.apache.qpid=${amqj.logging.level}, console
+log4j.additivity.org.apache.qpid=false
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.Threshold=all
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index ca8ba5e619..7f17dad8e6 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -34,7 +34,6 @@ import org.apache.qpid.exchange.ExchangeDefaults; import org.apache.qpid.framing.*; import org.apache.qpid.jms.Session; import org.apache.qpid.protocol.AMQConstant; -import org.apache.qpid.server.handler.ExchangeBoundHandler; import org.apache.qpid.url.AMQBindingURL; import org.apache.qpid.url.URLSyntaxException; @@ -1425,7 +1424,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi throw new JMSAMQException(e); } ExchangeBoundOkBody responseBody = (ExchangeBoundOkBody) response.getMethod(); - return (responseBody.replyCode == ExchangeBoundHandler.OK); + return (responseBody.replyCode == 0); //ExchangeBoundHandler.OK); Remove Broker compile dependency } private void checkTransacted() throws JMSException diff --git a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingClient.java b/java/client/src/old_test/java/org/apache/qpid/ping/TestPingClient.java deleted file mode 100644 index b060498d9b..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingClient.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.ping; - -import org.apache.log4j.Logger; -import org.apache.log4j.Level; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQTopic; -import org.apache.qpid.client.AMQQueue; -import org.apache.qpid.jms.Session; - -import javax.jms.*; -import java.net.InetAddress; - -public class TestPingClient -{ - private static final Logger _logger = Logger.getLogger(TestPingClient.class); - - private static class TestPingMessageListener implements MessageListener - { - public TestPingMessageListener() - { - } - - long _lastTimestamp = 0L; - long _lastTimestampString = 0L; - - public void onMessage(javax.jms.Message message) - { - if (_logger.isInfoEnabled()) - { - long timestamp = 0L; - long timestampString = 0L; - - try - { - timestamp = message.getLongProperty("timestamp"); - timestampString = Long.parseLong(message.getStringProperty("timestampString")); - - if (timestampString != timestamp) - { - _logger.info("Timetamps differ!:\n" + - "timestamp:" + timestamp + "\n" + - "timestampString:" + timestampString); - } - - } - catch (JMSException jmse) - { - } - - long diff = timestamp - _lastTimestamp; - _lastTimestamp = timestamp; - - long stringDiff = timestampString - _lastTimestampString; - - _lastTimestampString = timestampString; - - _logger.info("Ping: T:" + diff + "ms, TS:" + stringDiff); - - // _logger.info(_name + " got message '" + message + "\n"); - } - } - } - - public static void main(String[] args) - { - _logger.setLevel(Level.INFO); - - _logger.info("Starting..."); - - if (args.length < 4) - { - System.out.println("Usage: brokerdetails username password virtual-path [selector] "); - System.exit(1); - } - try - { - InetAddress address = InetAddress.getLocalHost(); - AMQConnection con1 = new AMQConnection(args[0], args[1], args[2], - address.getHostName(), args[3]); - - final org.apache.qpid.jms.Session session1 = (org.apache.qpid.jms.Session) - con1.createSession(false, Session.AUTO_ACKNOWLEDGE); - - - String selector = null; - - if (args.length == 5) - { - selector = args[4]; - } - - _logger.info("Message selector is <" + selector + ">..."); - - Queue q = new AMQQueue("ping"); - - MessageConsumer consumer1 = session1.createConsumer(q, - 1, false, false, selector); - - consumer1.setMessageListener(new TestPingMessageListener()); - con1.start(); - } - catch (Throwable t) - { - System.err.println("Fatal error: " + t); - t.printStackTrace(); - } - - System.out.println("Waiting..."); - } -} - diff --git a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingProducer.java b/java/client/src/old_test/java/org/apache/qpid/ping/TestPingProducer.java deleted file mode 100644 index 458dca0d56..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingProducer.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.ping; - -import org.apache.log4j.Logger; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.AMQException; -import org.apache.qpid.url.URLSyntaxException; -import org.apache.qpid.client.AMQNoConsumersException; -import org.apache.qpid.client.BasicMessageProducer; -import org.apache.qpid.client.AMQQueue; -import org.apache.qpid.jms.MessageProducer; -import org.apache.qpid.jms.Session; - -import javax.jms.*; -import java.net.InetAddress; -import java.net.UnknownHostException; - -/** - * A client that behaves as follows: - * <ul><li>Connects to a queue, whose name is specified as a cmd-line argument</li> - * <li>Creates a temporary queue</li> - * <li>Creates messages containing a property that is the name of the temporary queue</li> - * <li>Fires off a message on the original queue and waits for a response on the temporary queue</li> - * </ul> - */ -public class TestPingProducer implements ExceptionListener -{ - private static final Logger _log = Logger.getLogger(TestPingProducer.class); - - private AMQConnection _connection; - - private Session _session; - - private boolean _publish; - - private long SLEEP_TIME = 250L; - - private class CallbackHandler implements MessageListener - { - - private int _actualMessageCount; - - - public void onMessage(Message m) - { - if (_log.isDebugEnabled()) - { - _log.debug("Message received: " + m); - } - _actualMessageCount++; - if (_actualMessageCount % 1000 == 0) - { - _log.info("Received message count: " + _actualMessageCount); - } - } - } - - public TestPingProducer(boolean TRANSACTED, String brokerDetails, String clientID, - String virtualpath) throws AMQException, URLSyntaxException - { - try - { - createConnection(brokerDetails, clientID, virtualpath); - - if (TRANSACTED) - { - _session = (Session) _connection.createSession(true, Session.SESSION_TRANSACTED); - } - else - { - _session = (Session) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - } - - AMQQueue destination = new AMQQueue("ping"); - MessageProducer producer = (MessageProducer) _session.createProducer(destination); - - _connection.setExceptionListener(this); - - _connection.start(); - - int messageNumber = 0; - - while (_publish) - { -/* - TextMessage msg = _session.createTextMessage( - "Presented to in conjunction with Mahnah Mahnah and the Snowths: " + ++messageNumber); -*/ - ObjectMessage msg = _session.createObjectMessage(); - - msg.setStringProperty("timestampString", Long.toString(System.currentTimeMillis())); - msg.setLongProperty("timestamp", System.currentTimeMillis()); - - ((BasicMessageProducer) producer).send(msg, DeliveryMode.NON_PERSISTENT, true); - - - if (TRANSACTED) - { - try{ - _session.commit(); - _log.info("Message Sent.");// +"\n"+ msg); - }catch (JMSException e) - { - try - { - _session.rollback(); - } - catch (JMSException jsme) - { - _log.info(jsme); - } - - - if (e.getLinkedException() instanceof AMQNoConsumersException) - { - _log.info("No Consumers never mind."); - - continue; - } - } - } - - - if (SLEEP_TIME > 0) - { - try - { - Thread.sleep(SLEEP_TIME); - } - catch (InterruptedException ie) - { - //do nothing - } - } - - - } - - } - catch (JMSException e) - { - _publish = false; - e.printStackTrace(); - } - } - - private void createConnection(String brokerDetails, String clientID, String virtualpath) throws AMQException, URLSyntaxException - { - _publish = true; - _connection = new AMQConnection(brokerDetails, "guest", "guest", - clientID, virtualpath); - } - - /** - * @param args argument 1 if present specifies the name of the temporary queue to create. Leaving it blank - * means the server will allocate a name. - */ - public static void main(String[] args) throws URLSyntaxException - { - if (args.length == 0) - { - System.err.println("Usage: TestPingPublisher <brokerDetails> <virtual path> [transacted]"); - System.exit(0); - } - try - { - InetAddress address = InetAddress.getLocalHost(); - String clientID = address.getHostName() + System.currentTimeMillis(); - new TestPingProducer(args.length == 3, args[0], clientID, args[1]); - } - catch (UnknownHostException e) - { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - catch (AMQException e) - { - System.err.println("Error in client: " + e); - e.printStackTrace(); - } - - //System.exit(0); - } - - /** - * @see javax.jms.ExceptionListener#onException(javax.jms.JMSException) - */ - public void onException(JMSException e) - { - System.err.println(e.getMessage()); - - _publish = false; - e.printStackTrace(System.err); - } -} diff --git a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingPublisher.java b/java/client/src/old_test/java/org/apache/qpid/ping/TestPingPublisher.java deleted file mode 100644 index c7742be042..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingPublisher.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.ping; - -import org.apache.log4j.Logger; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.AMQException; -import org.apache.qpid.url.URLSyntaxException; -import org.apache.qpid.client.AMQTopic; -import org.apache.qpid.client.BasicMessageProducer; -import org.apache.qpid.jms.MessageProducer; -import org.apache.qpid.jms.Session; - -import javax.jms.*; -import java.net.InetAddress; -import java.net.UnknownHostException; - -/** - * A client that behaves as follows: - * <ul><li>Connects to a queue, whose name is specified as a cmd-line argument</li> - * <li>Creates a temporary queue</li> - * <li>Creates messages containing a property that is the name of the temporary queue</li> - * <li>Fires off a message on the original queue and waits for a response on the temporary queue</li> - * </ul> - */ -public class TestPingPublisher implements ExceptionListener -{ - private static final Logger _log = Logger.getLogger(TestPingPublisher.class); - - private AMQConnection _connection; - - private Session _session; - - private boolean _publish; - - private long SLEEP_TIME = 0L; - - private class CallbackHandler implements MessageListener - { - - private int _actualMessageCount; - - - public void onMessage(Message m) - { - if (_log.isDebugEnabled()) - { - _log.debug("Message received: " + m); - } - _actualMessageCount++; - if (_actualMessageCount % 1000 == 0) - { - _log.info("Received message count: " + _actualMessageCount); - } - } - } - - public TestPingPublisher(String brokerDetails, String clientID, String virtualpath) throws AMQException, URLSyntaxException - { - try - { - createConnection(brokerDetails, clientID, virtualpath); - - _session = (Session) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - //AMQQueue destination = new AMQQueue("ping"); - AMQTopic destination = new AMQTopic("ping"); - MessageProducer producer = (MessageProducer) _session.createProducer(destination); - - _connection.setExceptionListener(this); - - _connection.start(); - - int messageNumber = 0; - - while (_publish) - { -/* - TextMessage msg = _session.createTextMessage( - "Presented to in conjunction with Mahnah Mahnah and the Snowths: " + ++messageNumber); -*/ - ObjectMessage msg = _session.createObjectMessage(); - - Long time = System.nanoTime(); - msg.setStringProperty("timestampString", Long.toString(time)); - msg.setLongProperty("timestamp", time); - - ((BasicMessageProducer) producer).send(msg, DeliveryMode.PERSISTENT, true); - - _log.info("Message Sent:\n" + msg); - - if (SLEEP_TIME > 0) - { - try - { - Thread.sleep(SLEEP_TIME); - } - catch (InterruptedException ie) - { - //do nothing - } - } - - - } - - } - catch (JMSException e) - { - e.printStackTrace(); - } - } - - private void createConnection(String brokerDetails, String clientID, String virtualpath) throws AMQException, URLSyntaxException - { - _publish = true; - _connection = new AMQConnection(brokerDetails, "guest", "guest", - clientID, virtualpath); - - } - - /** - * @param args argument 1 if present specifies the name of the temporary queue to create. Leaving it blank - * means the server will allocate a name. - */ - public static void main(String[] args) throws URLSyntaxException - { - if (args.length == 0) - { - System.err.println("Usage: TestPingPublisher <brokerDetails> <virtual path>"); - System.exit(0); - } - try - { - InetAddress address = InetAddress.getLocalHost(); - String clientID = address.getHostName() + System.currentTimeMillis(); - new TestPingPublisher(args[0], clientID, args[1]); - } - catch (UnknownHostException e) - { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - catch (AMQException e) - { - System.err.println("Error in client: " + e); - e.printStackTrace(); - } - - //System.exit(0); - } - - /** - * @see javax.jms.ExceptionListener#onException(javax.jms.JMSException) - */ - public void onException(JMSException e) - { - System.err.println(e.getMessage()); - - _publish = false; - e.printStackTrace(System.err); - } -} diff --git a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingSubscriber.java b/java/client/src/old_test/java/org/apache/qpid/ping/TestPingSubscriber.java deleted file mode 100644 index 8e8c3f2e6e..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/ping/TestPingSubscriber.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.ping; - -import org.apache.log4j.Logger; -import org.apache.log4j.Level; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQTopic; -import org.apache.qpid.jms.Session; - -import javax.jms.MessageConsumer; -import javax.jms.MessageListener; -import javax.jms.Topic; -import javax.jms.JMSException; -import java.net.InetAddress; - -public class TestPingSubscriber -{ - private static final Logger _logger = Logger.getLogger(TestPingClient.class); - - private static class TestPingMessageListener implements MessageListener - { - public TestPingMessageListener() - { - } - - long _lastTimestamp = 0L; - long _lastTimestampString = 0L; - - public void onMessage(javax.jms.Message message) - { - Long time = System.nanoTime(); - - if (_logger.isInfoEnabled()) - { - long timestamp = 0L; - long timestampString = 0L; - - try - { - timestamp = message.getLongProperty("timestamp"); - timestampString = Long.parseLong(message.getStringProperty("timestampString")); - - if (timestampString != timestamp) - { - _logger.info("Timetamps differ!:\n" + - "timestamp:" + timestamp + "\n" + - "timestampString:" + timestampString); - } - - } - catch (JMSException jmse) - { - } - - long diff = time - timestamp; - - long stringDiff = time - timestampString; - - _logger.info("Ping: TS:" + stringDiff/1000+"us"); - - // _logger.info(_name + " got message '" + message + "\n"); - } - } - } - - public static void main(String[] args) - { - _logger.setLevel(Level.INFO); - - _logger.info("Starting..."); - - if (args.length < 4) - { - System.out.println("Usage: brokerdetails username password virtual-path [selector] "); - System.exit(1); - } - try - { - InetAddress address = InetAddress.getLocalHost(); - AMQConnection con1 = new AMQConnection(args[0], args[1], args[2], - address.getHostName(), args[3]); - - final org.apache.qpid.jms.Session session1 = (org.apache.qpid.jms.Session) - con1.createSession(false, Session.AUTO_ACKNOWLEDGE); - - - String selector = null; - - if (args.length == 5) - { - selector = args[4]; - } - - _logger.info("Message selector is <" + selector + ">..."); - - Topic t = new AMQTopic("ping"); - - MessageConsumer consumer1 = session1.createConsumer(t, - 1, false, false, selector); - - consumer1.setMessageListener(new TestPingMessageListener()); - con1.start(); - } - catch (Throwable t) - { - System.err.println("Fatal error: " + t); - t.printStackTrace(); - } - - System.out.println("Waiting..."); - } -} - diff --git a/java/client/src/old_test/java/org/apache/qpid/requestreply1/ServiceProvidingClient.java b/java/client/src/old_test/java/org/apache/qpid/requestreply1/ServiceProvidingClient.java deleted file mode 100644 index 7cbec7c85c..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/requestreply1/ServiceProvidingClient.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.requestreply1; - -import org.apache.log4j.Logger; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQQueue; -import org.apache.qpid.jms.Session; -import org.apache.qpid.jms.ConnectionListener; -import org.apache.qpid.AMQException; -import org.apache.qpid.url.URLSyntaxException; - -import javax.jms.*; -import java.net.InetAddress; -import java.net.UnknownHostException; - -public class ServiceProvidingClient -{ - private static final Logger _logger = Logger.getLogger(ServiceProvidingClient.class); - - private MessageProducer _destinationProducer; - - private Destination _responseDest; - - private AMQConnection _connection; - - public ServiceProvidingClient(String brokerDetails, String username, String password, - String clientName, String virtualPath, String serviceName) - throws AMQException, JMSException, URLSyntaxException - { - _connection = new AMQConnection(brokerDetails, username, password, - clientName, virtualPath); - _connection.setConnectionListener(new ConnectionListener() - { - - public void bytesSent(long count) - { - } - - public void bytesReceived(long count) - { - } - - public boolean preFailover(boolean redirect) - { - return true; - } - - public boolean preResubscribe() - { - return true; - } - - public void failoverComplete() - { - _logger.info("App got failover complete callback"); - } - }); - final Session session = (Session) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - _logger.info("Service (queue) name is '" + serviceName + "'..."); - - AMQQueue destination = new AMQQueue(serviceName); - - MessageConsumer consumer = session.createConsumer(destination, - 100, true, false, null); - - consumer.setMessageListener(new MessageListener() - { - private int _messageCount; - - public void onMessage(Message message) - { - //_logger.info("Got message '" + message + "'"); - - TextMessage tm = (TextMessage) message; - - try - { - Destination responseDest = tm.getJMSReplyTo(); - if (responseDest == null) - { - _logger.info("Producer not created because the response destination is null."); - return; - } - - if (!responseDest.equals(_responseDest)) - { - _responseDest = responseDest; - - _logger.info("About to create a producer"); - _destinationProducer = session.createProducer(responseDest); - _destinationProducer.setDisableMessageTimestamp(true); - _destinationProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); - _logger.info("After create a producer"); - } - } - catch (JMSException e) - { - _logger.error("Error creating destination"); - } - _messageCount++; - if (_messageCount % 1000 == 0) - { - _logger.info("Received message total: " + _messageCount); - _logger.info("Sending response to '" + _responseDest + "'"); - } - - try - { - String payload = "This is a response: sing together: 'Mahnah mahnah...'" + tm.getText(); - TextMessage msg = session.createTextMessage(payload); - if (tm.propertyExists("timeSent")) - { - _logger.info("timeSent property set on message"); - _logger.info("timeSent value is: " + tm.getLongProperty("timeSent")); - msg.setStringProperty("timeSent", tm.getStringProperty("timeSent")); - } - _destinationProducer.send(msg); - if (_messageCount % 1000 == 0) - { - _logger.info("Sent response to '" + _responseDest + "'"); - } - } - catch (JMSException e) - { - _logger.error("Error sending message: " + e, e); - } - } - }); - } - - public void run() throws JMSException - { - _connection.start(); - _logger.info("Waiting..."); - } - - public static void main(String[] args) - { - _logger.info("Starting..."); - - if (args.length < 5) - { - System.out.println("Usage: brokerDetails username password virtual-path serviceQueue [selector]"); - System.exit(1); - } - String clientId = null; - try - { - InetAddress address = InetAddress.getLocalHost(); - clientId = address.getHostName() + System.currentTimeMillis(); - } - catch (UnknownHostException e) - { - _logger.error("Error: " + e, e); - } - - try - { - ServiceProvidingClient client = new ServiceProvidingClient(args[0], args[1], args[2], - clientId, args[3], args[4]); - client.run(); - } - catch (JMSException e) - { - _logger.error("Error: " + e, e); - } - catch (AMQException e) - { - _logger.error("Error: " + e, e); - } - catch (URLSyntaxException e) - { - _logger.error("Error: " + e, e); - } - - - - } - -} - diff --git a/java/client/src/old_test/java/org/apache/qpid/requestreply1/ServiceRequestingClient.java b/java/client/src/old_test/java/org/apache/qpid/requestreply1/ServiceRequestingClient.java deleted file mode 100644 index 74becfd9bb..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/requestreply1/ServiceRequestingClient.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.requestreply1; - -import org.apache.log4j.Logger; -import org.apache.qpid.AMQException; -import org.apache.qpid.url.URLSyntaxException; -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQQueue; -import org.apache.qpid.client.AMQDestination; -import org.apache.qpid.jms.MessageConsumer; -import org.apache.qpid.jms.MessageProducer; -import org.apache.qpid.jms.Session; - -import javax.jms.*; -import java.net.InetAddress; -import java.net.UnknownHostException; - -/** - * A client that behaves as follows: - * <ul><li>Connects to a queue, whose name is specified as a cmd-line argument</li> - * <li>Creates a temporary queue</li> - * <li>Creates messages containing a property that is the name of the temporary queue</li> - * <li>Fires off a message on the original queue and waits for a response on the temporary queue</li> - * </ul> - * - */ -public class ServiceRequestingClient implements ExceptionListener -{ - private static final Logger _log = Logger.getLogger(ServiceRequestingClient.class); - - private static final String MESSAGE_DATA_BYTES = "jfd ghljgl hjvhlj cvhvjf ldhfsj lhfdsjf hldsjfk hdslkfj hsdflk "; - - private String MESSAGE_DATA; - - private AMQConnection _connection; - - private Session _session; - - private long _averageLatency; - - private int _messageCount; - - private volatile boolean _completed; - - private AMQDestination _tempDestination; - - private MessageProducer _producer; - - private Object _waiter; - - private static String createMessagePayload(int size) - { - _log.info("Message size set to " + size + " bytes"); - StringBuffer buf = new StringBuffer(size); - int count = 0; - while (count < size + MESSAGE_DATA_BYTES.length()) - { - buf.append(MESSAGE_DATA_BYTES); - count += MESSAGE_DATA_BYTES.length(); - } - if (count < size) - { - buf.append(MESSAGE_DATA_BYTES, 0, size - count); - } - - return buf.toString(); - } - - private class CallbackHandler implements MessageListener - { - private int _expectedMessageCount; - - private int _actualMessageCount; - - private long _startTime; - - public CallbackHandler(int expectedMessageCount, long startTime) - { - _expectedMessageCount = expectedMessageCount; - _startTime = startTime; - } - - public void onMessage(Message m) - { - if (_log.isDebugEnabled()) - { - _log.debug("Message received: " + m); - } - try - { - m.getPropertyNames(); - if (m.propertyExists("timeSent")) - { - long timeSent = Long.parseLong(m.getStringProperty("timeSent")); - long now = System.currentTimeMillis(); - if (_averageLatency == 0) - { - _averageLatency = now - timeSent; - _log.info("Latency " + _averageLatency); - } - else - { - _log.info("Individual latency: " + (now - timeSent)); - _averageLatency = (_averageLatency + (now - timeSent)) / 2; - _log.info("Average latency now: " + _averageLatency); - } - } - } - catch (JMSException e) - { - _log.error("Error getting latency data: " + e, e); - } - _actualMessageCount++; - if (_actualMessageCount % 1000 == 0) - { - _log.info("Received message count: " + _actualMessageCount); - } - - if (_actualMessageCount == _expectedMessageCount) - { - _completed = true; - notifyWaiter(); - long timeTaken = System.currentTimeMillis() - _startTime; - _log.info("Total time taken to receive " + _expectedMessageCount + " messages was " + - timeTaken + "ms, equivalent to " + - (_expectedMessageCount / (timeTaken / 1000.0)) + " messages per second"); - - try - { - _connection.close(); - _log.info("Connection closed"); - } - catch (JMSException e) - { - _log.error("Error closing connection"); - } - } - } - } - - private void notifyWaiter() - { - if (_waiter != null) - { - synchronized (_waiter) - { - _waiter.notify(); - } - } - } - public ServiceRequestingClient(String brokerHosts, String clientID, String username, String password, - String vpath, String commandQueueName, - final int messageCount, final int messageDataLength) throws AMQException, URLSyntaxException - { - _messageCount = messageCount; - MESSAGE_DATA = createMessagePayload(messageDataLength); - try - { - createConnection(brokerHosts, clientID, username, password, vpath); - _session = (Session) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - - _connection.setExceptionListener(this); - - - AMQQueue destination = new AMQQueue(commandQueueName); - _producer = (MessageProducer) _session.createProducer(destination); - _producer.setDisableMessageTimestamp(true); - _producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); - - _tempDestination = new AMQQueue("TempResponse" + - Long.toString(System.currentTimeMillis()), true); - MessageConsumer messageConsumer = (MessageConsumer) _session.createConsumer(_tempDestination, 100, true, - true, null); - - //Send first message, then wait a bit to allow the provider to get initialised - TextMessage first = _session.createTextMessage(MESSAGE_DATA); - first.setJMSReplyTo(_tempDestination); - _producer.send(first); - try - { - Thread.sleep(1000); - } - catch (InterruptedException ignore) - { - } - - //now start the clock and the test... - final long startTime = System.currentTimeMillis(); - - messageConsumer.setMessageListener(new CallbackHandler(messageCount, startTime)); - } - catch (JMSException e) - { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - } - - /** - * Run the test and notify an object upon receipt of all responses. - * @param waiter the object that will be notified - * @throws JMSException - */ - public void run(Object waiter) throws JMSException - { - _waiter = waiter; - _connection.start(); - for (int i = 1; i < _messageCount; i++) - { - TextMessage msg = _session.createTextMessage(MESSAGE_DATA + i); - msg.setJMSReplyTo(_tempDestination); - if (i % 1000 == 0) - { - long timeNow = System.currentTimeMillis(); - msg.setStringProperty("timeSent", String.valueOf(timeNow)); - } - _producer.send(msg); - } - _log.info("Finished sending " + _messageCount + " messages"); - } - - public boolean isCompleted() - { - return _completed; - } - - private void createConnection(String brokerHosts, String clientID, String username, String password, - String vpath) throws AMQException, URLSyntaxException - { - _connection = new AMQConnection(brokerHosts, username, password, - clientID, vpath); - } - - /** - * @param args argument 1 if present specifies the name of the temporary queue to create. Leaving it blank - * means the server will allocate a name. - */ - public static void main(String[] args) - { - if (args.length < 6) - { - System.err.println( - "Usage: ServiceRequestingClient <brokerDetails - semicolon separated host:port list> <username> <password> <vpath> <command queue name> <number of messages> <message size>"); - } - try - { - int messageDataLength = args.length > 6 ? Integer.parseInt(args[6]) : 4096; - - InetAddress address = InetAddress.getLocalHost(); - String clientID = address.getHostName() + System.currentTimeMillis(); - ServiceRequestingClient client = new ServiceRequestingClient(args[0], clientID, args[1], args[2], args[3], - args[4], Integer.parseInt(args[5]), - messageDataLength); - Object waiter = new Object(); - client.run(waiter); - synchronized (waiter) - { - while (!client.isCompleted()) - { - waiter.wait(); - } - } - - } - catch (UnknownHostException e) - { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - catch (Exception e) - { - System.err.println("Error in client: " + e); - e.printStackTrace(); - } - } - - /** - * @see javax.jms.ExceptionListener#onException(javax.jms.JMSException) - */ - public void onException(JMSException e) - { - System.err.println(e.getMessage()); - e.printStackTrace(System.err); - } -} diff --git a/java/client/src/old_test/java/org/apache/qpid/requestreply1/VmRequestReply.java b/java/client/src/old_test/java/org/apache/qpid/requestreply1/VmRequestReply.java deleted file mode 100644 index a1577cffa5..0000000000 --- a/java/client/src/old_test/java/org/apache/qpid/requestreply1/VmRequestReply.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * 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. - * - */ -package org.apache.qpid.requestreply1; - -import junit.framework.TestCase; -import org.apache.log4j.Logger; -import org.apache.qpid.testutil.VMBrokerSetup; - -public class VmRequestReply extends TestCase -{ - private static final Logger _logger = Logger.getLogger(VmRequestReply.class); - - public void testSimpleClient() throws Exception - { - ServiceProvidingClient serviceProvider = new ServiceProvidingClient("vm://:1", "guest", "guest", - "serviceProvidingClient", "/test", - "serviceQ"); - - ServiceRequestingClient serviceRequester = new ServiceRequestingClient("vm://:1", "myClient", "guest", "guest", - "/test", "serviceQ", 5000, 512); - - serviceProvider.run(); - Object waiter = new Object(); - serviceRequester.run(waiter); - synchronized (waiter) - { - while (!serviceRequester.isCompleted()) - { - waiter.wait(); - } - } - } - - public static void main(String[] args) - { - VmRequestReply rr = new VmRequestReply(); - try - { - rr.testSimpleClient(); - } - catch (Exception e) - { - _logger.error("Error: " + e, e); - } - } - - public static junit.framework.Test suite() - { - return new VMBrokerSetup(new junit.framework.TestSuite(VmRequestReply.class)); - } -} diff --git a/java/common/pom.xml b/java/common/pom.xml index dc0db7f954..654f6dcde3 100644 --- a/java/common/pom.xml +++ b/java/common/pom.xml @@ -68,21 +68,37 @@ </build> <dependencies> + <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </dependency> + <dependency> <groupId>org.apache.mina</groupId> - <artifactId>mina-core</artifactId> + <artifactId>mina-java5</artifactId> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> + + <dependency> + <groupId>org.apache.mina</groupId> + <artifactId>mina-filter-ssl</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.mina</groupId> + <artifactId>mina-core</artifactId> </dependency> + <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jms_1.1_spec</artifactId> </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + </dependencies> </project> diff --git a/java/distribution/pom.xml b/java/distribution/pom.xml index 59b4107454..c662ef2038 100644 --- a/java/distribution/pom.xml +++ b/java/distribution/pom.xml @@ -16,7 +16,10 @@ 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"> +<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-distribution</artifactId> @@ -36,7 +39,7 @@ <qpid.version>${pom.version}</qpid.version> <qpid.targetDir>${project.build.directory}</qpid.targetDir> </properties> - + <repositories> <repository> <id>repo1.maven.org</id> @@ -48,36 +51,21 @@ <dependencies> <dependency> <groupId>${pom.groupId}</groupId> - <artifactId>qpid-common</artifactId> - <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> <artifactId>qpid-broker</artifactId> <version>${pom.version}</version> + <type>jar</type> </dependency> <dependency> <groupId>${pom.groupId}</groupId> <artifactId>qpid-client</artifactId> <version>${pom.version}</version> - </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>qpid-perftests</artifactId> - <version>${pom.version}</version> + <type>jar</type> </dependency> <dependency> <groupId>${pom.groupId}.management</groupId> <artifactId>org.apache.qpid.management.ui</artifactId> <version>${pom.version}</version> </dependency> - <dependency> - <groupId>${pom.groupId}</groupId> - <artifactId>qpid-systests</artifactId> - <version>${pom.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> </dependencies> <build> @@ -96,9 +84,6 @@ <artifactId>maven-assembly-plugin</artifactId> <version>${assembly.version}</version> <configuration> - <descriptors> - <descriptor>src/main/assembly/bin.xml</descriptor> - </descriptors> <finalName>qpid-${pom.version}</finalName> <outputDirectory>${qpid.targetDir}</outputDirectory> <tarLongFileMode>gnu</tarLongFileMode> @@ -118,14 +103,7 @@ </plugin> </plugins> </pluginManagement> - <resources> - <resource> - <directory>src/main/java</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - </resources> + <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> @@ -139,11 +117,7 @@ <configuration> <descriptors> <descriptor>src/main/assembly/bin.xml</descriptor> - <descriptor>src/main/assembly/client-bin.xml</descriptor> <descriptor>src/main/assembly/src.xml</descriptor> - <descriptor>src/main/assembly/management-eclipse-plugin.xml</descriptor> - <descriptor>src/main/assembly/management-eclipse-plugin-unix.xml</descriptor> - <descriptor>src/main/assembly/tests.xml</descriptor> </descriptors> <finalName>qpid-${pom.version}</finalName> </configuration> @@ -152,4 +126,74 @@ </plugin> </plugins> </build> -</project> + + <profiles> + <profile> + <id>tests</id> + + <dependencies> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>qpid-broker</artifactId> + <version>${pom.version}</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>qpid-broker</artifactId> + <version>${pom.version}</version> + <type>test-jar</type> + </dependency> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>qpid-client</artifactId> + <version>${pom.version}</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>qpid-client</artifactId> + <version>${pom.version}</version> + <type>test-jar</type> + </dependency> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>qpid-perftests</artifactId> + <version>${pom.version}</version> + <type>test-jar</type> + </dependency> + <dependency> + <groupId>${pom.groupId}</groupId> + <artifactId>qpid-systests</artifactId> + <version>${pom.version}</version> + <type>test-jar</type> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/bin-test.xml</descriptor> + </descriptors> + <finalName>qpid-${pom.version}</finalName> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + + </profile> + </profiles> + +</project> diff --git a/java/distribution/src/main/assembly/bin-test.xml b/java/distribution/src/main/assembly/bin-test.xml new file mode 100644 index 0000000000..6d78687fa7 --- /dev/null +++ b/java/distribution/src/main/assembly/bin-test.xml @@ -0,0 +1,175 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <!-- id typically identifies the "type" (src vs bin etc) of the assembly --> + <id>java-bin-with-tests</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + + <fileSets> + <fileSet> + <directory>src/main/release</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>..</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>*.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/release/etc</directory> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <includes> + <include>logging.properties</include> + <include>log4j.properties</include> + </includes> + </fileSet> + <fileSet> + <directory>src/main/release/docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>target</directory> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <includes> + <include>qpid-incubating.jar</include> + </includes> + </fileSet> + </fileSets> + <files> + <!-- due to a bug in the assembly plugin (MASSEMBLY-153) you have + to use decimal numbers to specify fileMode --> + <file> + <source>../common/etc/qpid-run.conf</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>qpid-run.conf</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../broker/etc/config.xml</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>config.xml</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../broker/etc/log4j.xml</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>log4j.xml</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../broker/etc/passwd</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>passwd</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../broker/etc/qpid-server.conf</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>qpid-server.conf</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../broker/etc/virtualhosts.xml</source> + <outputDirectory>qpid-${qpid.version}/etc</outputDirectory> + <destName>virtualhosts.xml</destName> + <fileMode>420</fileMode> + </file> + <file> + <source>../common/bin/qpid-run</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-run</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../broker/bin/qpid-server</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-server</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../broker/bin/qpid-server.bat</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>qpid-server.bat</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../broker/bin/run.bat</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>run.bat</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../broker/bin/run.sh</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>run.sh</destName> + <fileMode>493</fileMode> + </file> + <file> + <source>../broker/bin/runAll</source> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <destName>runAll</destName> + <fileMode>493</fileMode> + </file> + </files> + <dependencySets> + <dependencySet> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <unpack>false</unpack> + <excludes> + <exclude>org.apache.qpid:qpid-distribution</exclude> + <exclude>org.apache.qpid.management:org.apache.qpid.management.ui</exclude> + <exclude>org.eclipse.core:org.eclipse.core.commands</exclude> + <exclude>org.eclipse.core:org.eclipse.core.contenttype</exclude> + <exclude>org.eclipse.core:org.eclipse.core.expressions</exclude> + <exclude>org.eclipse.core:org.eclipse.core.jobs</exclude> + <exclude>org.eclipse.core:org.eclipse.core.runtime</exclude> + <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.auth</exclude> + <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude> + <exclude>org.eclipse.equinox:org.eclipse.equinox.common</exclude> + <exclude>org.eclipse.equinox:org.eclipse.equinox.preferences</exclude> + <exclude>org.eclipse.equinox:org.eclipse.equinox.registry</exclude> + <exclude>org.eclipse.help:org.eclipse.help</exclude> + <exclude>org.eclipse.jface:org.eclipse.jface</exclude> + <exclude>org.eclipse.osgi:org.eclipse.osgi</exclude> + <exclude>org.eclipse.swt:org.eclipse.swt</exclude> + <exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86</exclude> + <exclude>org.eclipse.ui:org.eclipse.ui</exclude> + <exclude>org.eclipse.ui:org.eclipse.ui.forms</exclude> + <exclude>org.eclipse.ui:org.eclipse.ui.workbench</exclude> + </excludes> + <scope>runtime</scope> + </dependencySet> + </dependencySets> +</assembly> diff --git a/java/distribution/src/main/assembly/bin.xml b/java/distribution/src/main/assembly/bin.xml index fa3ed7dd06..00ffd86bd0 100644 --- a/java/distribution/src/main/assembly/bin.xml +++ b/java/distribution/src/main/assembly/bin.xml @@ -66,14 +66,6 @@ <include>qpid-incubating.jar</include> </includes> </fileSet> - <fileSet> - <directory>../perftests/bin</directory> - <outputDirectory>qpid-${qpid.version}/bin/perftests</outputDirectory> - <includes> - <include>*</include> - </includes> - </fileSet> - </fileSets> <files> <!-- due to a bug in the assembly plugin (MASSEMBLY-153) you have diff --git a/java/perftests/bin/setupclasspath.sh b/java/perftests/bin/setupclasspath.sh index 29ca661aab..ef7a037c11 100755 --- a/java/perftests/bin/setupclasspath.sh +++ b/java/perftests/bin/setupclasspath.sh @@ -2,9 +2,11 @@ if [ -z $QPID_HOME ] ; then echo "QPID_HOME must be set" exit fi -CP=$QPID_HOME/lib/qpid-incubating.jar:../target/classes + +CP=../lib/qpid-performance.jar:$QPID_HOME/lib/qpid-incubating.jar if [ `uname -o` == "Cygwin" ] ; then CP=`cygpath --path --windows $CP` fi + diff --git a/java/perftests/distribution/pom.xml b/java/perftests/distribution/pom.xml new file mode 100644 index 0000000000..3359520706 --- /dev/null +++ b/java/perftests/distribution/pom.xml @@ -0,0 +1,110 @@ +<!-- + 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-perftests-distribution</artifactId> + <packaging>jar</packaging> + <version>1.0-incubating-M2-SNAPSHOT</version> + <name>Qpid Performance Tests Distribution</name> + <url>http://cwiki.apache.org/confluence/display/qpid</url> + + <parent> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid</artifactId> + <version>1.0-incubating-M2-SNAPSHOT</version> + </parent> + + <properties> + <topDirectoryLocation>..</topDirectoryLocation> + <java.source.version>1.5</java.source.version> + <qpid.version>${pom.version}</qpid.version> + <qpid.targetDir>${project.build.directory}</qpid.targetDir> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-perftests</artifactId> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>${java.source.version}</source> + <target>${java.source.version}</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>${assembly.version}</version> + <configuration> + <finalName>qpid-${pom.version}</finalName> + <outputDirectory>${qpid.targetDir}</outputDirectory> + <tarLongFileMode>gnu</tarLongFileMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <finalName>qpid-performance</finalName> + <archive> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + </archive> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/performance.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + +</project> diff --git a/java/perftests/distribution/src/main/assembly/performance.xml b/java/perftests/distribution/src/main/assembly/performance.xml new file mode 100644 index 0000000000..36daeb6760 --- /dev/null +++ b/java/perftests/distribution/src/main/assembly/performance.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <id>performance-test-java</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + + <fileSets> + <fileSet> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>..</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>*.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>../../release-docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>../bin</directory> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <includes> + <include>*</include> + </includes> + </fileSet> + <fileSet> + <directory>../src/main</directory> + <outputDirectory>qpid-${qpid.version}/src</outputDirectory> + <includes> + <include>**/*.java</include> + <include>**/*.log4j</include> + </includes> + </fileSet> + + <fileSet> + <directory>target</directory> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <includes> + <include>qpid-performance.jar</include> + </includes> + </fileSet> + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <unpack>false</unpack> + <excludes> + <exclude>org.apache.qpid:qpid-perftests-distribution</exclude> + </excludes> + </dependencySet> + </dependencySets> +G</assembly> diff --git a/java/perftests/pom.xml b/java/perftests/pom.xml index 9ca30da0ae..98d2696b80 100644 --- a/java/perftests/pom.xml +++ b/java/perftests/pom.xml @@ -57,8 +57,10 @@ <skip>true</skip> </configuration> </plugin> + </plugins> - <!-- Include source files in built jar --> + + <!-- Include source files in built jar --> <resources> <resource> <targetPath>src/</targetPath> @@ -69,13 +71,14 @@ </includes> </resource> <resource> - <targetPath></targetPath> - <filtering>false</filtering> - <directory>src/main/java</directory> - <includes> - <include>perftests.log4j</include> - </includes> + <targetPath>src/</targetPath> + <filtering>false</filtering> + <directory>src/main/java</directory> + <includes> + <include>perftests.log4j</include> + </includes> </resource> </resources> </build> + </project> diff --git a/java/pom.xml b/java/pom.xml index 25dba411e5..db5820c0e3 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -65,6 +65,7 @@ <archive>http://mail-archives.apache.org/mod_mbox/incubator-qpid-commits</archive> </mailingList> </mailingLists> + <licenses> <license> <name>The Apache Software License, Version 2.0</name> @@ -72,10 +73,12 @@ <distribution>repo</distribution> </license> </licenses> + <organization> <name>Apache Software Foundation</name> <url>http://www.apache.org/</url> </organization> + <properties> <topDirectoryLocation>.</topDirectoryLocation> @@ -148,6 +151,7 @@ </includes> </resource> </resources> + <testResources> <testResource> <directory>src/test/java</directory> @@ -183,7 +187,6 @@ <artifactId>ant-nodeps</artifactId> <version>1.6.5</version> </dependency> - </dependencies> <executions> @@ -232,16 +235,19 @@ </execution> </executions> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>${jar.version}</version> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>${resources.version}</version> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> @@ -252,6 +258,7 @@ <fork>${compile.forked}</fork> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -273,11 +280,13 @@ </systemproperties> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>${site.version}</version> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> @@ -292,14 +301,16 @@ </projectnatures> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-idea-plugin</artifactId> <configuration> - <downloadSources>true</downloadSources> + <!--downloadSources>true</downloadSources--> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clover-plugin</artifactId> @@ -407,6 +418,8 @@ <artifactId>backport-util-concurrent</artifactId> <version>2.2</version> </dependency> + + <!-- Test Dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -419,6 +432,8 @@ <version>2.2</version> <scope>test</scope> </dependency> + + <!-- Qpid Version Dependencies --> <dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-common</artifactId> @@ -436,6 +451,16 @@ </dependency> <dependency> <groupId>org.apache.qpid</groupId> + <artifactId>qpid-perftests</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-systests</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.qpid</groupId> <artifactId>qpid-mgmt-core</artifactId> <version>${project.version}</version> </dependency> diff --git a/java/resources/DISCLAIMER b/java/resources/DISCLAIMER new file mode 100644 index 0000000000..c321113c9e --- /dev/null +++ b/java/resources/DISCLAIMER @@ -0,0 +1,5 @@ +Apache Qpid is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. + +Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. + +While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. diff --git a/java/resources/LICENSE.txt b/java/resources/LICENSE.txt new file mode 100755 index 0000000000..6b0b1270ff --- /dev/null +++ b/java/resources/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/java/resources/NOTICE.txt b/java/resources/NOTICE.txt new file mode 100644 index 0000000000..82d3dbc632 --- /dev/null +++ b/java/resources/NOTICE.txt @@ -0,0 +1,36 @@ +========================================================================= +== NOTICE file corresponding to the section 4 d of == +== the Apache License, Version 2.0, == +== in this case for the Apache Qpid distribution. == +========================================================================= + +This product includes software developed by the Apache Software Foundation +(http://www.apache.org/). + +Please read the LICENSE.txt file present in the root directory of this +distribution. + + +Aside from contributions to the Apache Qpid project, this software also +includes (binary only): + + - The SAXON XSLT Processor from Michael Kay distributed under the + Mozilla Public License v1.0, which is available for download at + http://saxon.sourceforge.net/ + + - The JUnit regression testing framework written by Erich Gamma + and Kent Beck and distributed under the Common Public License v1.0. + JUnit is available for download at + http://sourceforge.net/projects/junit/ + + - The Simple Logging Facade For Java (slf4j), Copyright (c) + 2004-2005 SLF4J.ORG, Copyright (c) 2004-2005 QOS.ch. slf4j is + licensed under identical terms to the MIT/X11 license and + available for download at http://www.slf4j.org/ + + - Software from the Eclipse project. The binaries from this project are + distributed under the Eclipse Public License and can be donwloaded + from http://www.eclipse.org/ + + + diff --git a/java/resources/README.txt b/java/resources/README.txt new file mode 100644 index 0000000000..14706170bc --- /dev/null +++ b/java/resources/README.txt @@ -0,0 +1,104 @@ + +Documentation +-------------- +All of our user documentation for the Qpid Java components can be accessed on our wiki at: + +http://cwiki.apache.org/confluence/display/qpid/Qpid+Java+Documentation + +This includes a Getting Started Guide and FAQ as well as detailed developer documentation. +However, here's a VERY quick guide to running the installed Qpid broker, once you have installed it somewhere ! + + +Running the Broker +------------------ + +To run the broker, set the QPID_HOME environment variable to +distribution directory and add $QPID_HOME/bin to your PATH. Then run +the qpid-server shell script or qpid-server.bat batch file to start +the broker. By default, the broker will use $QPID_HOME/etc to find +the configuration files. You can supply a custom configuration using +the -c argument. + +For example: + +qpid-server -c ~/etc/config.xml + +You can get a list of all command line arguments by using the -h argument. + + +Developing +---------- + +In order to build Qpid you need Ant 1.6.5. Use ant -p to list the +available targets. The default ant target, build, creates a working +development-mode distribution in the build directory. To run the +scripts in build/bin set QPID_HOME to the build directory and put +${QPID_HOME}/bin on your PATH. The scripts in that directory include +the standard ones in the distribution and a number of testing scripts. + + +Running Tests +------------- + +The simplest test to ensure everything is working is the "service +request reply" test. This involves one client that is known as a +"service provider" and it listens on a well-known queue for +requests. Another client, known as the "service requester" creates a +private (temporary) response queue, creates a message with the private +response queue set as the "reply to" field and then publishes the +message to the well known service queue. The test allows you to time +how long it takes to send messages and receive the response back. It +also allows varying of the message size. + +You must start the service provider first: + +serviceProvidingClient.sh nop host:port + +where host:port is the host and port you are running the broker +on. + +To run the service requester: + +serviceRequestingClient.sh nop host:post <count> <bytes> + +This requests <count> messages, each of size <bytes>. After +receiving all the messages the client outputs the rate it achieved. + +A more realistic test is the "headers test", which tests the +performance of routing messages based on message headers to a +configurable number of clients (e.g. 50). A publisher sends 10000 +messages to each client and waits to receive a message from each +client when it has received all the messages. + +You run the listener processes first: + +run_many.sh 10 header "headersListener.sh -host 10.0.0.1 -port 5672" + +In this command, the first argument means start 10 processes, the +second is just a name use in the log files generated and the third +argument is the command to run. In this case it runs another shell +script but it could be anything. + +Then run the publisher process: + +headersPublisher.sh -host 10.0.0.1 -port 5672 10000 10 + +The last two arguments are: the number of messages to send to each +client, and the number of clients. + +Note that before starting the publisher you should wait about 30 +seconds to ensure all the clients are registered with the broker (you +can see this from the broker output). Otherwise the numbers will be +slightly skewed. + +A third useful test, which can easily be ported to other JMS +implementations is the "topic test". It does the same as the headers +test but using a standard topic (e.g. pub sub). + +To run the listeners: + +run_many.sh 10 topic "topicListener.sh -host 10.0.0.1 -port 5672" + +and to run the publisher: + +topicPublisher.sh -host 10.0.0.1 -port 5672 -clients 10 -messages 10000 diff --git a/java/systests/distribution/pom.xml b/java/systests/distribution/pom.xml new file mode 100644 index 0000000000..bff1e0d9e5 --- /dev/null +++ b/java/systests/distribution/pom.xml @@ -0,0 +1,111 @@ +<!-- + 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-systests-distribution</artifactId> + <packaging>jar</packaging> + <version>1.0-incubating-M2-SNAPSHOT</version> + <name>Qpid System Tests Distribution</name> + <url>http://cwiki.apache.org/confluence/display/qpid</url> + + <parent> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid</artifactId> + <version>1.0-incubating-M2-SNAPSHOT</version> + </parent> + + <properties> + <topDirectoryLocation>..</topDirectoryLocation> + <java.source.version>1.5</java.source.version> + <qpid.version>${pom.version}</qpid.version> + <qpid.targetDir>${project.build.directory}</qpid.targetDir> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.qpid</groupId> + <artifactId>qpid-systests</artifactId> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>${java.source.version}</source> + <target>${java.source.version}</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>${assembly.version}</version> + <configuration> + <finalName>qpid-${pom.version}</finalName> + <outputDirectory>${qpid.targetDir}</outputDirectory> + <tarLongFileMode>gnu</tarLongFileMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <finalName>qpid-systests</finalName> + <archive> + <manifest> + <addClasspath>true</addClasspath> + </manifest> + </archive> + </configuration> + </plugin> + + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>distribution-package</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <descriptors> + <descriptor>src/main/assembly/systests.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + +</project> diff --git a/java/systests/distribution/src/main/assembly/systests.xml b/java/systests/distribution/src/main/assembly/systests.xml new file mode 100644 index 0000000000..2d6a6d8572 --- /dev/null +++ b/java/systests/distribution/src/main/assembly/systests.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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. +--> +<assembly> + <id>system-test-java</id> + <includeBaseDirectory>false</includeBaseDirectory> + <formats> + <format>tar.gz</format> + <format>zip</format> + </formats> + +<fileSets> + <!-- Apache Licensing Details--> + <fileSet> + <directory>../../resources</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>DISCLAIMER</include> + <include>LICENSE.txt</include> + <include>NOTICE.txt</include> + <include>README.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>..</directory> + <outputDirectory>qpid-${qpid.version}</outputDirectory> + <includes> + <include>*.txt</include> + </includes> + </fileSet> + <fileSet> + <directory>../../release-docs</directory> + <outputDirectory>qpid-${qpid.version}/docs</outputDirectory> + <includes> + <include>RELEASE_NOTES.txt</include> + </includes> + </fileSet> + + <!-- Scripts to run the system tests--> + <fileSet> + <directory>../bin</directory> + <outputDirectory>qpid-${qpid.version}/bin</outputDirectory> + <includes> + <include>*</include> + </includes> + </fileSet> + + <!-- Include source files in easy access form --> + <fileSet> + <directory>../src/main</directory> + <outputDirectory>qpid-${qpid.version}/src</outputDirectory> + <includes> + <include>**/*.java</include> + <include>**/*.log4j</include> + </includes> + </fileSet> + <fileSet> + <directory>target</directory> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <includes> + <include>qpid-systests.jar</include> + </includes> + </fileSet> + </fileSets> + + <dependencySets> + <dependencySet> + <outputDirectory>qpid-${qpid.version}/lib</outputDirectory> + <unpack>false</unpack> + <excludes> + <exclude>org.apache.qpid:qpid-systests-distribution</exclude> + </excludes> + </dependencySet> + </dependencySets> +</assembly> diff --git a/java/systests/pom.xml b/java/systests/pom.xml index 8f6413148f..614166754c 100644 --- a/java/systests/pom.xml +++ b/java/systests/pom.xml @@ -39,23 +39,20 @@ <dependencies> <dependency> <groupId>org.apache.qpid</groupId> - <artifactId>qpid-common</artifactId> - </dependency> - <dependency> - <groupId>org.apache.qpid</groupId> <artifactId>qpid-client</artifactId> + <type>jar</type> </dependency> + <dependency> <groupId>org.apache.qpid</groupId> <artifactId>qpid-broker</artifactId> + <type>jar</type> </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> + <scope>compile</scope> </dependency> </dependencies> @@ -65,38 +62,30 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> - <systemProperties> - <property> - <name>amqj.noAutoCreateVMBroker</name> - <value>true</value> - </property> - <property> - <name>amqj.logging.level</name> - <value>${amqj.logging.level}</value> - </property> - <property> - <name>log4j.debug</name> - <value>true</value> - </property> - <property> - <name>log4j.configuration</name> - <value>file:///${basedir}/src/test/java/log4j.properties</value> - </property> - </systemProperties> + <skip>true</skip> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <id>bundle-test-jar</id> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> + </plugins> + + <!-- Include source files in built jar --> + <resources> + <resource> + <targetPath>src/</targetPath> + <filtering>false</filtering> + <directory>src/main/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </resource> + <resource> + <targetPath>src/</targetPath> + <filtering>false</filtering> + <directory>src/main/java</directory> + <includes> + <include>systests.log4j</include> + </includes> + </resource> + </resources> </build> </project> diff --git a/java/systests/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java b/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java index ec27b8a191..ec27b8a191 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/ack/TxAckTest.java b/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java index 9d3c588fc8..9d3c588fc8 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/ack/TxAckTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java b/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java index ea576a5661..ea576a5661 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java +++ b/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java b/java/systests/src/main/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java index 39c47118da..39c47118da 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java b/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java index c01241d11d..c01241d11d 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java b/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java index 546c61eda0..546c61eda0 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java b/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java index c2ac099855..c2ac099855 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/protocol/MockIoSession.java b/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java index cf6366b513..cf6366b513 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/protocol/MockIoSession.java +++ b/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java index 91a26632a1..91a26632a1 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java index d10d5acdd0..d10d5acdd0 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/ConcurrencyTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTest.java index e428b9ef60..e428b9ef60 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/ConcurrencyTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/ConcurrentDeliveryManagerTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManagerTest.java index 1943532a51..1943532a51 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/ConcurrentDeliveryManagerTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrentDeliveryManagerTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/DeliveryManagerTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/DeliveryManagerTest.java index d88614298f..d88614298f 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/DeliveryManagerTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/DeliveryManagerTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/MessageTestHelper.java b/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java index 6c48bb2bf4..6c48bb2bf4 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/MessageTestHelper.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/MockProtocolSession.java b/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java index 3586749f53..3586749f53 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/MockProtocolSession.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java index d3ec3c11d4..d3ec3c11d4 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/SubscriptionSetTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionSetTest.java index bcf54693d3..bcf54693d3 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/SubscriptionSetTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionSetTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java b/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java index fea3c93280..fea3c93280 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/queue/SynchronizedDeliveryManagerTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManagerTest.java index 3c5aab0911..3c5aab0911 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/queue/SynchronizedDeliveryManagerTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/SynchronizedDeliveryManagerTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java b/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java index 34f70bd2db..34f70bd2db 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java +++ b/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/store/TestReferenceCounting.java b/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java index e2500d9865..e2500d9865 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/store/TestReferenceCounting.java +++ b/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java b/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java index 9a649421dd..9a649421dd 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java +++ b/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/txn/TxnBufferTest.java b/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java index 1d9e30c24e..1d9e30c24e 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/txn/TxnBufferTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/util/AveragedRun.java b/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java index 1d17985ab5..1d17985ab5 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/util/AveragedRun.java +++ b/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/util/RunStats.java b/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java index ec67fc68b3..ec67fc68b3 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/util/RunStats.java +++ b/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java b/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java index f801daf27c..f801daf27c 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java +++ b/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java diff --git a/java/systests/src/test/java/org/apache/qpid/server/util/TimedRun.java b/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java index 1291380311..1291380311 100644 --- a/java/systests/src/test/java/org/apache/qpid/server/util/TimedRun.java +++ b/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java diff --git a/java/systests/src/test/java/org/apache/qpid/test/VMBrokerSetup.java b/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java index e859fac4af..e859fac4af 100644 --- a/java/systests/src/test/java/org/apache/qpid/test/VMBrokerSetup.java +++ b/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java diff --git a/java/client/src/main/java/log4j.properties b/java/systests/src/main/java/systests.log4j index 6d596d1d19..6d596d1d19 100644 --- a/java/client/src/main/java/log4j.properties +++ b/java/systests/src/main/java/systests.log4j |