Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-01-14 05:27:01 -0500
committerEike Stepper2012-01-14 05:27:01 -0500
commit0266166cb9ff9535c150250073ea1e57b42d2693 (patch)
treec006a3bc0ba1f6e1d8a2bc032eedc346f71eab0d /plugins/org.eclipse.net4j.jms.tests
parent7416443692cdda72d1f704ea4fc5ececcc669df7 (diff)
downloadcdo-0266166cb9ff9535c150250073ea1e57b42d2693.tar.gz
cdo-0266166cb9ff9535c150250073ea1e57b42d2693.tar.xz
cdo-0266166cb9ff9535c150250073ea1e57b42d2693.zip
Adjusted copyrights to 2012
Diffstat (limited to 'plugins/org.eclipse.net4j.jms.tests')
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/.settings/org.eclipse.jdt.ui.prefs240
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/build.properties48
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/config/org.eclipse.net4j.jms.server.jdbc.properties32
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/copyright.txt14
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/plugin.properties36
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java294
-rw-r--r--plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java264
7 files changed, 456 insertions, 472 deletions
diff --git a/plugins/org.eclipse.net4j.jms.tests/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.net4j.jms.tests/.settings/org.eclipse.jdt.ui.prefs
index b319a35c0d..9e6b01e75f 100644
--- a/plugins/org.eclipse.net4j.jms.tests/.settings/org.eclipse.jdt.ui.prefs
+++ b/plugins/org.eclipse.net4j.jms.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -1,120 +1,120 @@
-#Thu Feb 04 09:44:24 CET 2010
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_missing_override_annotations_interface_methods=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.correct_indentation=true
-cleanup.format_source_code=true
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=false
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=true
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=true
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_EMFT
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_EMFT
-formatter_settings_version=11
-org.eclipse.jdt.ui.exception.name=ex
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.staticondemandthreshold=99
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/*\r\n * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=true
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=true
-sp_cleanup.use_this_for_non_static_field_access=true
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=true
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+#Thu Feb 04 09:44:24 CET 2010
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_EMFT
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMFT
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/*\r\n * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.net4j.jms.tests/build.properties b/plugins/org.eclipse.net4j.jms.tests/build.properties
index 686955d4b9..c86aa7a0fd 100644
--- a/plugins/org.eclipse.net4j.jms.tests/build.properties
+++ b/plugins/org.eclipse.net4j.jms.tests/build.properties
@@ -1,24 +1,24 @@
-# Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# NLS_MESSAGEFORMAT_VAR
-
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- copyright.txt,\
- plugin.properties,\
- config/
-src.includes = about.html,\
- copyright.txt,\
- JMSSeparatedTest.launch,\
- JMSTest.launch,\
- RMIRegistry.launch
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ copyright.txt,\
+ plugin.properties,\
+ config/
+src.includes = about.html,\
+ copyright.txt,\
+ JMSSeparatedTest.launch,\
+ JMSTest.launch,\
+ RMIRegistry.launch
diff --git a/plugins/org.eclipse.net4j.jms.tests/config/org.eclipse.net4j.jms.server.jdbc.properties b/plugins/org.eclipse.net4j.jms.tests/config/org.eclipse.net4j.jms.server.jdbc.properties
index 1129d34fa3..da2a631d82 100644
--- a/plugins/org.eclipse.net4j.jms.tests/config/org.eclipse.net4j.jms.server.jdbc.properties
+++ b/plugins/org.eclipse.net4j.jms.tests/config/org.eclipse.net4j.jms.server.jdbc.properties
@@ -1,17 +1,15 @@
-# Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# NLS_MESSAGEFORMAT_VAR
-
-store.instanceID = TEST0001
-store.dbAdapter = derby
-
-datasource.class = org.apache.derby.jdbc.EmbeddedDataSource
-datasource.databaseName = C:/temp/jmsdb
-datasource.createDatabase = create
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+store.instanceID = TEST0001
+store.dbAdapter = derby
+
+datasource.class = org.apache.derby.jdbc.EmbeddedDataSource
+datasource.databaseName = C:/temp/jmsdb
+datasource.createDatabase = create
diff --git a/plugins/org.eclipse.net4j.jms.tests/copyright.txt b/plugins/org.eclipse.net4j.jms.tests/copyright.txt
index 77d945dca6..8f6328980e 100644
--- a/plugins/org.eclipse.net4j.jms.tests/copyright.txt
+++ b/plugins/org.eclipse.net4j.jms.tests/copyright.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
-
-Contributors:
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
Eike Stepper - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.jms.tests/plugin.properties b/plugins/org.eclipse.net4j.jms.tests/plugin.properties
index 6129b73ab0..104669f754 100644
--- a/plugins/org.eclipse.net4j.jms.tests/plugin.properties
+++ b/plugins/org.eclipse.net4j.jms.tests/plugin.properties
@@ -1,25 +1,11 @@
-# Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# NLS_MESSAGEFORMAT_VAR
-
-# ==============================================================================
-# Do not change the properties between this line and the last line containing:
-# %%% END OF TRANSLATED PROPERTIES %%%
-# Instead, either redefine an existing property, or create a new property,
-# append it to the end of the file, and change the code to use the new name.
-# ==============================================================================
-
-pluginName = Net4j JMS Provider Tests (Experimental)
-providerName = Eclipse Modeling Project
-
-# ==============================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# The above properties have been shipped for translation.
-# ==============================================================================
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+pluginName = Net4j JMS Provider Tests (Experimental)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java
index 1613d524c4..b774c18023 100644
--- a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java
+++ b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSSeparatedTest.java
@@ -1,147 +1,147 @@
-/*
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.jms.tests;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.derby.EmbeddedDerbyAdapter;
-import org.eclipse.net4j.jms.JMSInitialContext;
-import org.eclipse.net4j.jms.admin.IJMSAdmin;
-import org.eclipse.net4j.jms.admin.JMSAdminUtil;
-import org.eclipse.net4j.jms.internal.server.Server;
-import org.eclipse.net4j.jms.server.IStore;
-import org.eclipse.net4j.jms.server.JMSServerUtil;
-import org.eclipse.net4j.jms.server.jdbc.JDBCUtil;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.ManagedContainer;
-import org.eclipse.net4j.util.io.IOUtil;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-public class JMSSeparatedTest
-{
- public static void main(String[] args) throws Exception
- {
- try
- {
- Context context = init();
- ConnectionFactory connectionFactory = (ConnectionFactory)context.lookup("net4j.jms.ConnectionFactory"); //$NON-NLS-1$
- Destination destination = (Destination)context.lookup("StockTopic"); //$NON-NLS-1$
-
- Connection connection = connectionFactory.createConnection();
- Session session = connection.createSession(true, 0);
-
- MessageProducer publisher = session.createProducer(destination);
- MessageConsumer subscriber1 = session.createConsumer(destination);
- MessageConsumer subscriber2 = session.createConsumer(destination);
- subscriber1.setMessageListener(new MessageLogger("subscriber1")); //$NON-NLS-1$
- subscriber2.setMessageListener(new MessageLogger("subscriber2")); //$NON-NLS-1$
-
- connection.start();
-
- publisher.send(session.createObjectMessage("Message 1")); //$NON-NLS-1$
- publisher.send(session.createObjectMessage("Message 2")); //$NON-NLS-1$
- publisher.send(session.createObjectMessage("Message 3")); //$NON-NLS-1$
- publisher.send(session.createObjectMessage("Message 4")); //$NON-NLS-1$
-
- session.commit();
- }
- finally
- {
- ConcurrencyUtil.sleep(500);
- Server.INSTANCE.deactivate();
- }
- }
-
- private static Context init() throws Exception
- {
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.setDebugging(true);
-
- initServer();
- return initClient();
- }
-
- private static void initServer() throws Exception
- {
- IDBAdapter.REGISTRY.put(EmbeddedDerbyAdapter.NAME, new EmbeddedDerbyAdapter());
- IStore store = JDBCUtil.getStore();
- Server.INSTANCE.setStore(store);
- Server.INSTANCE.activate();
-
- IManagedContainer serverContainer = new ManagedContainer();
- Net4jUtil.prepareContainer(serverContainer);
- TCPUtil.prepareContainer(serverContainer);
- JMSServerUtil.prepareContainer(serverContainer);
-
- TCPUtil.getAcceptor(serverContainer, null);
- }
-
- private static Context initClient() throws NamingException
- {
- IManagedContainer clientContainer = new ManagedContainer();
- Net4jUtil.prepareContainer(clientContainer);
- TCPUtil.prepareContainer(clientContainer);
-
- IConnector connector = TCPUtil.getConnector(clientContainer, "localhost"); //$NON-NLS-1$
-
- IJMSAdmin admin = JMSAdminUtil.createAdmin(connector);
- admin.createQueue("StockQueue"); //$NON-NLS-1$
- admin.createTopic("StockTopic"); //$NON-NLS-1$
-
- return new JMSInitialContext(clientContainer);
- }
-
- /**
- * @author Eike Stepper
- */
- private static final class MessageLogger implements MessageListener
- {
- private String name;
-
- public MessageLogger(String name)
- {
- this.name = name;
- }
-
- public void onMessage(Message message)
- {
- try
- {
- Object object = ((ObjectMessage)message).getObject();
- IOUtil.OUT().println("\n------> MESSAGE for " + name + ": " + object + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- message.acknowledge();
- }
- catch (JMSException ex)
- {
- IOUtil.print(ex);
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.jms.tests;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.derby.EmbeddedDerbyAdapter;
+import org.eclipse.net4j.jms.JMSInitialContext;
+import org.eclipse.net4j.jms.admin.IJMSAdmin;
+import org.eclipse.net4j.jms.admin.JMSAdminUtil;
+import org.eclipse.net4j.jms.internal.server.Server;
+import org.eclipse.net4j.jms.server.IStore;
+import org.eclipse.net4j.jms.server.JMSServerUtil;
+import org.eclipse.net4j.jms.server.jdbc.JDBCUtil;
+import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.container.ManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.PrintLogHandler;
+import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+public class JMSSeparatedTest
+{
+ public static void main(String[] args) throws Exception
+ {
+ try
+ {
+ Context context = init();
+ ConnectionFactory connectionFactory = (ConnectionFactory)context.lookup("net4j.jms.ConnectionFactory"); //$NON-NLS-1$
+ Destination destination = (Destination)context.lookup("StockTopic"); //$NON-NLS-1$
+
+ Connection connection = connectionFactory.createConnection();
+ Session session = connection.createSession(true, 0);
+
+ MessageProducer publisher = session.createProducer(destination);
+ MessageConsumer subscriber1 = session.createConsumer(destination);
+ MessageConsumer subscriber2 = session.createConsumer(destination);
+ subscriber1.setMessageListener(new MessageLogger("subscriber1")); //$NON-NLS-1$
+ subscriber2.setMessageListener(new MessageLogger("subscriber2")); //$NON-NLS-1$
+
+ connection.start();
+
+ publisher.send(session.createObjectMessage("Message 1")); //$NON-NLS-1$
+ publisher.send(session.createObjectMessage("Message 2")); //$NON-NLS-1$
+ publisher.send(session.createObjectMessage("Message 3")); //$NON-NLS-1$
+ publisher.send(session.createObjectMessage("Message 4")); //$NON-NLS-1$
+
+ session.commit();
+ }
+ finally
+ {
+ ConcurrencyUtil.sleep(500);
+ Server.INSTANCE.deactivate();
+ }
+ }
+
+ private static Context init() throws Exception
+ {
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.setDebugging(true);
+
+ initServer();
+ return initClient();
+ }
+
+ private static void initServer() throws Exception
+ {
+ IDBAdapter.REGISTRY.put(EmbeddedDerbyAdapter.NAME, new EmbeddedDerbyAdapter());
+ IStore store = JDBCUtil.getStore();
+ Server.INSTANCE.setStore(store);
+ Server.INSTANCE.activate();
+
+ IManagedContainer serverContainer = new ManagedContainer();
+ Net4jUtil.prepareContainer(serverContainer);
+ TCPUtil.prepareContainer(serverContainer);
+ JMSServerUtil.prepareContainer(serverContainer);
+
+ TCPUtil.getAcceptor(serverContainer, null);
+ }
+
+ private static Context initClient() throws NamingException
+ {
+ IManagedContainer clientContainer = new ManagedContainer();
+ Net4jUtil.prepareContainer(clientContainer);
+ TCPUtil.prepareContainer(clientContainer);
+
+ IConnector connector = TCPUtil.getConnector(clientContainer, "localhost"); //$NON-NLS-1$
+
+ IJMSAdmin admin = JMSAdminUtil.createAdmin(connector);
+ admin.createQueue("StockQueue"); //$NON-NLS-1$
+ admin.createTopic("StockTopic"); //$NON-NLS-1$
+
+ return new JMSInitialContext(clientContainer);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class MessageLogger implements MessageListener
+ {
+ private String name;
+
+ public MessageLogger(String name)
+ {
+ this.name = name;
+ }
+
+ public void onMessage(Message message)
+ {
+ try
+ {
+ Object object = ((ObjectMessage)message).getObject();
+ IOUtil.OUT().println("\n------> MESSAGE for " + name + ": " + object + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ message.acknowledge();
+ }
+ catch (JMSException ex)
+ {
+ IOUtil.print(ex);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java
index f78f8627d3..03722161c1 100644
--- a/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java
+++ b/plugins/org.eclipse.net4j.jms.tests/src/org/eclipse/net4j/jms/tests/JMSTest.java
@@ -1,132 +1,132 @@
-/*
- * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.net4j.jms.tests;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.db.IDBAdapter;
-import org.eclipse.net4j.db.derby.EmbeddedDerbyAdapter;
-import org.eclipse.net4j.jms.JMSInitialContext;
-import org.eclipse.net4j.jms.admin.IJMSAdmin;
-import org.eclipse.net4j.jms.admin.JMSAdminUtil;
-import org.eclipse.net4j.jms.internal.server.Server;
-import org.eclipse.net4j.jms.server.IStore;
-import org.eclipse.net4j.jms.server.JMSServerUtil;
-import org.eclipse.net4j.jms.server.jdbc.JDBCUtil;
-import org.eclipse.net4j.tcp.TCPUtil;
-import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.ManagedContainer;
-import org.eclipse.net4j.util.io.IOUtil;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.PrintLogHandler;
-import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-import javax.naming.Context;
-
-public class JMSTest
-{
- public static void main(String[] args) throws Exception
- {
- try
- {
- Context context = init();
- ConnectionFactory connectionFactory = (ConnectionFactory)context.lookup("net4j.jms.ConnectionFactory"); //$NON-NLS-1$
- Destination destination = (Destination)context.lookup("StockTopic"); //$NON-NLS-1$
-
- Connection connection = connectionFactory.createConnection();
- Session session = connection.createSession(true, 0);
-
- MessageProducer publisher = session.createProducer(destination);
- MessageConsumer subscriber1 = session.createConsumer(destination);
- MessageConsumer subscriber2 = session.createConsumer(destination);
- subscriber1.setMessageListener(new MessageLogger("subscriber1")); //$NON-NLS-1$
- subscriber2.setMessageListener(new MessageLogger("subscriber2")); //$NON-NLS-1$
-
- connection.start();
-
- publisher.send(session.createObjectMessage("Message 1")); //$NON-NLS-1$
- publisher.send(session.createObjectMessage("Message 2")); //$NON-NLS-1$
- publisher.send(session.createObjectMessage("Message 3")); //$NON-NLS-1$
- publisher.send(session.createObjectMessage("Message 4")); //$NON-NLS-1$
-
- session.commit();
- }
- finally
- {
- ConcurrencyUtil.sleep(500);
- Server.INSTANCE.deactivate();
- }
- }
-
- private static Context init() throws Exception
- {
- OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
- OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
- OMPlatform.INSTANCE.setDebugging(true);
-
- IDBAdapter.REGISTRY.put(EmbeddedDerbyAdapter.NAME, new EmbeddedDerbyAdapter());
- IStore store = JDBCUtil.getStore();
- Server.INSTANCE.setStore(store);
- Server.INSTANCE.activate();
-
- IManagedContainer container = new ManagedContainer();
- Net4jUtil.prepareContainer(container);
- TCPUtil.prepareContainer(container);
- JMSServerUtil.prepareContainer(container);
-
- TCPUtil.getAcceptor(container, null);
- IConnector connector = TCPUtil.getConnector(container, "localhost"); //$NON-NLS-1$
-
- IJMSAdmin admin = JMSAdminUtil.createAdmin(connector);
- admin.createQueue("StockQueue"); //$NON-NLS-1$
- admin.createTopic("StockTopic"); //$NON-NLS-1$
-
- return new JMSInitialContext(container);
- }
-
- /**
- * @author Eike Stepper
- */
- private static final class MessageLogger implements MessageListener
- {
- private String name;
-
- public MessageLogger(String name)
- {
- this.name = name;
- }
-
- public void onMessage(Message message)
- {
- try
- {
- Object object = ((ObjectMessage)message).getObject();
- IOUtil.OUT().println("\n------> MESSAGE for " + name + ": " + object + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- message.acknowledge();
- }
- catch (JMSException ex)
- {
- IOUtil.print(ex);
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.jms.tests;
+
+import org.eclipse.net4j.Net4jUtil;
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.derby.EmbeddedDerbyAdapter;
+import org.eclipse.net4j.jms.JMSInitialContext;
+import org.eclipse.net4j.jms.admin.IJMSAdmin;
+import org.eclipse.net4j.jms.admin.JMSAdminUtil;
+import org.eclipse.net4j.jms.internal.server.Server;
+import org.eclipse.net4j.jms.server.IStore;
+import org.eclipse.net4j.jms.server.JMSServerUtil;
+import org.eclipse.net4j.jms.server.jdbc.JDBCUtil;
+import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
+import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.container.ManagedContainer;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.PrintLogHandler;
+import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+import javax.naming.Context;
+
+public class JMSTest
+{
+ public static void main(String[] args) throws Exception
+ {
+ try
+ {
+ Context context = init();
+ ConnectionFactory connectionFactory = (ConnectionFactory)context.lookup("net4j.jms.ConnectionFactory"); //$NON-NLS-1$
+ Destination destination = (Destination)context.lookup("StockTopic"); //$NON-NLS-1$
+
+ Connection connection = connectionFactory.createConnection();
+ Session session = connection.createSession(true, 0);
+
+ MessageProducer publisher = session.createProducer(destination);
+ MessageConsumer subscriber1 = session.createConsumer(destination);
+ MessageConsumer subscriber2 = session.createConsumer(destination);
+ subscriber1.setMessageListener(new MessageLogger("subscriber1")); //$NON-NLS-1$
+ subscriber2.setMessageListener(new MessageLogger("subscriber2")); //$NON-NLS-1$
+
+ connection.start();
+
+ publisher.send(session.createObjectMessage("Message 1")); //$NON-NLS-1$
+ publisher.send(session.createObjectMessage("Message 2")); //$NON-NLS-1$
+ publisher.send(session.createObjectMessage("Message 3")); //$NON-NLS-1$
+ publisher.send(session.createObjectMessage("Message 4")); //$NON-NLS-1$
+
+ session.commit();
+ }
+ finally
+ {
+ ConcurrencyUtil.sleep(500);
+ Server.INSTANCE.deactivate();
+ }
+ }
+
+ private static Context init() throws Exception
+ {
+ OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
+ OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
+ OMPlatform.INSTANCE.setDebugging(true);
+
+ IDBAdapter.REGISTRY.put(EmbeddedDerbyAdapter.NAME, new EmbeddedDerbyAdapter());
+ IStore store = JDBCUtil.getStore();
+ Server.INSTANCE.setStore(store);
+ Server.INSTANCE.activate();
+
+ IManagedContainer container = new ManagedContainer();
+ Net4jUtil.prepareContainer(container);
+ TCPUtil.prepareContainer(container);
+ JMSServerUtil.prepareContainer(container);
+
+ TCPUtil.getAcceptor(container, null);
+ IConnector connector = TCPUtil.getConnector(container, "localhost"); //$NON-NLS-1$
+
+ IJMSAdmin admin = JMSAdminUtil.createAdmin(connector);
+ admin.createQueue("StockQueue"); //$NON-NLS-1$
+ admin.createTopic("StockTopic"); //$NON-NLS-1$
+
+ return new JMSInitialContext(container);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class MessageLogger implements MessageListener
+ {
+ private String name;
+
+ public MessageLogger(String name)
+ {
+ this.name = name;
+ }
+
+ public void onMessage(Message message)
+ {
+ try
+ {
+ Object object = ((ObjectMessage)message).getObject();
+ IOUtil.OUT().println("\n------> MESSAGE for " + name + ": " + object + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ message.acknowledge();
+ }
+ catch (JMSException ex)
+ {
+ IOUtil.print(ex);
+ }
+ }
+ }
+}

Back to the top