001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)TestExchangePattern.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.messaging;
030:
031: import java.net.URI;
032:
033: /**
034: * The point of this test
035: *
036: * @author Sun Microsystems, Inc.
037: */
038: public class TestExchangePattern extends junit.framework.TestCase {
039: /** In Only MEP. */
040: public static final String REF_IN_ONLY = "http://www.w3.org/2004/08/wsdl/in-only";
041:
042: /** In Out MEP. */
043: public static final String REF_IN_OUT = "http://www.w3.org/2004/08/wsdl/in-out";
044:
045: /** In Optional Out MEP. */
046: public static final String REF_IN_OPTIONAL_OUT = "http://www.w3.org/2004/08/wsdl/in-opt-out";
047:
048: /** Robust In Only MEP. */
049: public static final String REF_ROBUST_IN_ONLY = "http://www.w3.org/2004/08/wsdl/robust-in-only";
050:
051: /**
052: * The constructor for this testcase, forwards the test name to
053: * the jUnit TestCase base class.
054: * @param aTestName String with the name of this test.
055: */
056: public TestExchangePattern(String aTestName) {
057: super (aTestName);
058: }
059:
060: /**
061: * Setup for the test.
062: * @throws Exception when set up fails for any reason.
063: */
064: public void setUp() throws Exception {
065: super .setUp();
066: }
067:
068: /**
069: * Cleanup for the test.
070: * @throws Exception when tearDown fails for any reason.
071: */
072: public void tearDown() throws Exception {
073: super .tearDown();
074:
075: }
076:
077: // ============================= test methods ================================
078:
079: /**
080: * Test to make sure URI strings returned from match our reference values.
081: */
082: public void testExchangePatternStrings() throws Exception {
083: assertEquals(ExchangePattern.IN_ONLY.toString(), REF_IN_ONLY);
084: assertEquals(ExchangePattern.IN_OUT.toString(), REF_IN_OUT);
085: assertEquals(ExchangePattern.IN_OPTIONAL_OUT.toString(),
086: REF_IN_OPTIONAL_OUT);
087: assertEquals(ExchangePattern.ROBUST_IN_ONLY.toString(),
088: REF_ROBUST_IN_ONLY);
089: }
090:
091: /**
092: * Test to make sure URIs returned from match our reference values.
093: */
094: public void testExchangePatternURIs() throws Exception {
095: assertEquals(ExchangePattern.IN_ONLY.getURI(), new URI(
096: REF_IN_ONLY));
097: assertEquals(ExchangePattern.IN_OUT.getURI(), new URI(
098: REF_IN_OUT));
099: assertEquals(ExchangePattern.IN_OPTIONAL_OUT.getURI(), new URI(
100: REF_IN_OPTIONAL_OUT));
101: assertEquals(ExchangePattern.ROBUST_IN_ONLY.getURI(), new URI(
102: REF_ROBUST_IN_ONLY));
103: }
104:
105: }
|