From 5bb876b10f1ba6a71451a4ae709d529a28aed245 Mon Sep 17 00:00:00 2001 From: beckerdo Date: Tue, 10 Feb 2009 20:36:13 +0000 Subject: TUSCANY-2835 JMS Binding does not save operation names unless there are properties. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@743094 13f79535-47bb-0310-9956-ffa450edef68 --- .../jms/impl/JMSBindingProcessorTestCase.java | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'branches/sca-java-1.x/modules/binding-jms/src/test') diff --git a/branches/sca-java-1.x/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java b/branches/sca-java-1.x/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java index 74524daf19..facdffffe9 100644 --- a/branches/sca-java-1.x/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java +++ b/branches/sca-java-1.x/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/impl/JMSBindingProcessorTestCase.java @@ -110,6 +110,22 @@ public class JMSBindingProcessorTestCase extends TestCase { + " " + ""; + private static final String OP_NAMES_NO_PROPERTIES1 = + "" + + "" + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + " " + + ""; + private static final String SELECTOR = "" + "" @@ -615,5 +631,28 @@ public class JMSBindingProcessorTestCase extends TestCase { assertEquals(77, ((Integer)value).intValue()); } + /** + * Tests the APIs: + * public Set getOperationNames(); + * Provides no optional properties or sub elements + * @throws Exception + */ + public void testOpProperties3() throws Exception { + XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(OP_NAMES_NO_PROPERTIES1)); + + Composite composite = (Composite)staxProcessor.read(reader); + JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0); + + assertNotNull(binding); + + Set opNames = binding.getOperationNames(); + assertEquals( 2, opNames.size() ); + // Recall that order is not guaranteed iterating over a set. + for (Iterator it=opNames.iterator(); it.hasNext(); ) { + String opName = it.next(); + assertTrue( opName.equals( "op1") || opName.equals( "op2")); + } + } + } -- cgit v1.2.3