Package org.objectweb.celtix.ws.rm

Examples of org.objectweb.celtix.ws.rm.Identifier


       
    }
   
    public void testDefaultConstruction() {    
       
        Identifier offeredSid = RMUtils.getWSRMFactory().createIdentifier();
        source.generateSequenceIdentifier();       
        EasyMock.expectLastCall().andReturn(offeredSid);
       
        control.replay();   
       
View Full Code Here


       
    }

    public void testConstructors() throws DatatypeConfigurationException {

        Identifier otherId = factory.createIdentifier();
        otherId.setValue("otherSeq");
       
        DestinationSequence seq = new DestinationSequence(id, ref, destination);
        assertEquals(id, seq.getIdentifier());
        assertNull(seq.getLastMessageNr());
        assertSame(ref, seq.getAcksTo());
View Full Code Here

        DestinationSequence otherSeq = null;
        assertTrue(!seq.equals(otherSeq));
        otherSeq = new DestinationSequence(id, ref, destination);
        assertEquals(seq, otherSeq);
        assertEquals(seq.hashCode(), otherSeq.hashCode());
        Identifier otherId = factory.createIdentifier();
        otherId.setValue("otherSeq");
        otherSeq = new DestinationSequence(otherId, ref, destination);
        assertTrue(!seq.equals(otherSeq));
        assertTrue(seq.hashCode() != otherSeq.hashCode());
        assertTrue(!seq.equals(this));
    }
View Full Code Here

        store.removeDestinationSequence(EasyMock.isA(Identifier.class));
        EasyMock.expectLastCall();
       
        control.replay();
        RMDestination d = new RMDestination(handler);
        Identifier sid = d.generateSequenceIdentifier();
        DestinationSequence seq = new DestinationSequence(sid, address, d);
        d.addSequence(seq);
        assertSame(seq, d.getSequence(sid));
        assertEquals(1, d.getAllSequences().size());
        d.removeSequence(seq);
View Full Code Here

        EasyMock.expect(handler.getConfiguration()).andReturn(c);
        EasyMock.expect(c.getObject(DestinationPolicyType.class, "destinationPolicies")).andReturn(null);
       
        control.replay();
        RMDestination d = new RMDestination(handler);
        Identifier sid = d.generateSequenceIdentifier();
        DestinationSequence seq = new DestinationSequence(sid, address, d);
        d.addSequence(seq);
        SequenceType st = RMUtils.getWSRMFactory().createSequenceType();
        st.setIdentifier(sid);
        BigInteger m = new BigInteger("3");
        st.setMessageNumber(m);
        d.acknowledge(st, RMUtils.getAddressingConstants().getNoneURI());
       
        Identifier unknown = d.generateSequenceIdentifier();
        st.setIdentifier(unknown);
        try {
            d.acknowledge(st, RMUtils.getAddressingConstants().getNoneURI());
            fail("Expected sequenceFault not thrown.");
        } catch (SequenceFault sf) {
View Full Code Here

    }

    public void testCreateDeleteSrcSequences() {
        IMocksControl control = EasyMock.createNiceControl();
        RMSourceSequence seq = control.createMock(RMSourceSequence.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getExpiry()).andReturn(null);
        EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(null);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
       
        control.replay();
        store.createSourceSequence(seq);  
        control.verify();
       
        control.reset();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getExpiry()).andReturn(null);
        EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(null);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
       
        control.replay();
        try {
            store.createSourceSequence(seq)
            fail("Expected RMStoreException was not thrown.");
        } catch (RMStoreException ex) {
            SQLException se = (SQLException)ex.getCause();
            // duplicate key value
            assertEquals("23505", se.getSQLState());
        }
        control.verify();
       
        control.reset();
        Identifier sid2 = RMUtils.getWSRMFactory().createIdentifier();
        sid2.setValue("sequence2");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid2)
        EasyMock.expect(seq.getExpiry()).andReturn(new Date());
        Identifier sid3 = RMUtils.getWSRMFactory().createIdentifier();
        sid3.setValue("offeringSequence3");
        EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(sid3);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        
        control.replay();
View Full Code Here

    }
   
    public void testCreateDeleteDestSequences() {
        IMocksControl control = EasyMock.createNiceControl();
        RMDestinationSequence seq = control.createMock(RMDestinationSequence.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createReference(Names.WSA_ANONYMOUS_ADDRESS);
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        control.replay();
        store.createDestinationSequence(seq);  
        control.verify();
       
        control.reset();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        control.replay();
        try {
            store.createDestinationSequence(seq)
            fail("Expected RMStoreException was not thrown.");
        } catch (RMStoreException ex) {
            SQLException se = (SQLException)ex.getCause();
            // duplicate key value
            assertEquals("23505", se.getSQLState());
        }
        control.verify();
       
        control.reset();
        Identifier sid2 = RMUtils.getWSRMFactory().createIdentifier();
        sid2.setValue("sequence2");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid2);
        epr = RMUtils.createReference(NON_ANON_ACKS_TO);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
       
View Full Code Here

    }
   
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        IMocksControl control = EasyMock.createNiceControl();
        RMMessage msg = control.createMock(RMMessage.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EasyMock.expect(msg.getMessageNr()).andReturn(BigInteger.ONE).times(2);
        InputStream is = new ByteArrayInputStream(new byte[89]);
        EasyMock.expect(msg.getContextAsStream()).andReturn(is).times(2);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNr()).andReturn(BigInteger.ONE);
        EasyMock.expect(msg.getContextAsStream()).andReturn(is);
       
        control.replay();
        store.beginTransaction();
        try {
            store.storeMessage(sid1, msg, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
        }
        store.abort();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg.getMessageNr()).andReturn(BigInteger.TEN).times(2);
        EasyMock.expect(msg.getContextAsStream()).andReturn(is).times(2);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg, true);
        store.storeMessage(sid1, msg, false);
        store.commit();
        control.verify();
       
        Collection<BigInteger> messageNrs = new ArrayList<BigInteger>();
        messageNrs.add(BigInteger.ZERO);
        messageNrs.add(BigInteger.TEN);
        messageNrs.add(BigInteger.ONE);
        messageNrs.add(BigInteger.TEN);
       
        store.removeMessages(sid1, messageNrs, true);
        store.removeMessages(sid1, messageNrs, false);
       
        Identifier sid2 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence2");
        store.removeMessages(sid2, messageNrs, true);
    }
View Full Code Here

    }
   
    public void testUpdateDestinationSequence() throws SQLException, IOException {
        IMocksControl control = EasyMock.createNiceControl();
        RMDestinationSequence seq = control.createMock(RMDestinationSequence.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createReference(Names.WSA_ANONYMOUS_ADDRESS);
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
View Full Code Here

    }
   
    public void testUpdateSourceSequence() throws SQLException {
        IMocksControl control = EasyMock.createNiceControl();
        RMSourceSequence seq = control.createMock(RMSourceSequence.class);
        Identifier sid1 = RMUtils.getWSRMFactory().createIdentifier();
        sid1.setValue("sequence1");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getExpiry()).andReturn(null);
        EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(null);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
       
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.ws.rm.Identifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.