FileDocCategorySizeDatePackage
CoordinationContextTest.javaAPI DocExample4850Tue May 29 16:57:44 BST 2007com.sun.xml.ws.tx.coordinator

CoordinationContextTest

public class CoordinationContextTest extends TestCase
author
Ryan.Shoemaker@Sun.COM

Fields Summary
CoordinationContextInterface
c
Constructors Summary
public CoordinationContextTest(String testname)
Creates a new instance of CoordinationContextTest

        super(testname);
    
Methods Summary
protected voidsetUp()

        // create a context to poke with a stick
        c = ContextFactory.createTestContext(Constants.WSAT_2004_PROTOCOL, 0l);
    
public voidtestContextExpiration1()

        assertEquals(0l, c.getExpires());
    
public voidtestContextExpiration2()

        CoordinationContext200410 c = new CoordinationContext200410();
        c.setExpires(-1);
        assert(c.getExpires() == 0l);
    
public voidtestContextFactory1()

        ContextFactory.createTestContext(Constants.WSAT_2004_PROTOCOL, 0l);
    
public voidtestContextFactory2()

        try {
            ContextFactory.createTestContext(Constants.WSAT_OASIS_NSURI, 0l);
        } catch(UnsupportedOperationException uoe) {
            return; // pass - expected exception
        }
        fail("Was expecting UnsupportedOperationException");
    
public voidtestContextGetAttrs()

        assert(c.getOtherAttributes().size()==0);  // should initially be empty
    
public voidtestContextIdPrefix()

        assert(c.getIdentifier().startsWith("uuid:WSCOOR-SUN-"));
    
public voidtestContextRegServiceEPR()

        EndpointReference epr = c.getRegistrationService();
        // TODO: figure out how to assert that the EPR is our registration
        //       service EPR
    
public voidtestContextRootReg()

        assertNull(c.getRootRegistrationService()); // should initially be null
    
public voidtestContextSetters()

        CoordinationContext200410 c = new CoordinationContext200410();
        c.setIdentifier("foo");
        c.setExpires(5000);
        c.setRegistrationService(null);
        c.setRootCoordinatorRegistrationService(null);
    
public voidtestContextType()

        assertEquals(Constants.WSAT_SOAP_NSURI, c.getCoordinationType());
    
public voidtestContextValue()

        assert(c.getValue() instanceof CoordinationContext200410);