Package wycc.io

Examples of wycc.io.Token$Identifier


    @Test
    public void createSoap12FaultWithAcknowledgementDetail() {
        SoapBinding sb = control.createMock(SoapBinding.class);
        EasyMock.expect(sb.getSoapVersion()).andReturn(Soap12.getInstance());       
        SequenceAcknowledgement ack = new SequenceAcknowledgement();
        Identifier id = new Identifier();
        id.setValue("sid");
        ack.setIdentifier(id);
        SequenceAcknowledgement.AcknowledgementRange range =
            new SequenceAcknowledgement.AcknowledgementRange();
        range.setLower(new Long(1));
        range.setUpper(new Long(10));
View Full Code Here


            (Long)EasyMock.eq(0L), EasyMock.eq(false))).andReturn(new Long(10)).anyTimes();
        EasyMock.expect(sseq.isLastMessage()).andReturn(false).anyTimes();
        interceptor.addAcknowledgements(EasyMock.same(destination), EasyMock.same(rmpsOut),
            (Identifier)EasyMock.isNull(), EasyMock.isA(AttributedURIType.class));
        EasyMock.expectLastCall();
        Identifier sid = control.createMock(Identifier.class);
        EasyMock.expect(sseq.getIdentifier()).andReturn(sid).anyTimes();
        EasyMock.expect(sseq.getCurrentMessageNr()).andReturn(new Long(10)).anyTimes();

       
        control.replay();
View Full Code Here

    }
   
    @Test
    public void testCreateDeleteSrcSequences() {
        SourceSequence seq = control.createMock(SourceSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getExpires()).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.getExpires()).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 = new Identifier();
        sid2.setValue("sequence2");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid2)
        EasyMock.expect(seq.getExpires()).andReturn(new Date());
        Identifier sid3 = new Identifier();
        sid3.setValue("offeringSequence3");
        EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(sid3);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
        
        control.replay();
View Full Code Here

    }
   
    @Test
    public void testCreateDeleteDestSequences() {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
        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 = new Identifier();
        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

   
    @Test
    public void testCreateDeleteMessages() throws IOException, SQLException  {
        RMMessage msg1 = control.createMock(RMMessage.class);
        RMMessage msg2 = control.createMock(RMMessage.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg2.getMessageNumber()).andReturn(ONE);
        byte[] bytes = new byte[89];
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
        EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg1, true);
        store.storeMessage(sid1, msg2, false);
        store.commit();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(ONE);
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        try {
            store.storeMessage(sid1, msg1, true);
        } catch (SQLException ex) {
            assertEquals("23505", ex.getSQLState());
        }
        store.abort();
        control.verify();
       
        control.reset();
        EasyMock.expect(msg1.getMessageNumber()).andReturn(TEN);
        EasyMock.expect(msg2.getMessageNumber()).andReturn(TEN);
        EasyMock.expect(msg1.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg1.getSize()).andReturn((long)bytes.length);
        EasyMock.expect(msg2.getInputStream()).andReturn(new ByteArrayInputStream(bytes));
        EasyMock.expect(msg2.getSize()).andReturn((long)bytes.length);
       
        control.replay();
        store.beginTransaction();
        store.storeMessage(sid1, msg1, true);
        store.storeMessage(sid1, msg2, false);
        store.commit();
        control.verify();
       
        Collection<Long> messageNrs = new ArrayList<Long>();
        messageNrs.add(ZERO);
        messageNrs.add(TEN);
        messageNrs.add(ONE);
        messageNrs.add(TEN);
       
        store.removeMessages(sid1, messageNrs, true);
        store.removeMessages(sid1, messageNrs, false);
       
        Identifier sid2 = new Identifier();
        sid1.setValue("sequence2");
        store.removeMessages(sid2, messageNrs, true);
    }
View Full Code Here

    }
   
    @Test
    public void testUpdateDestinationSequence() throws SQLException, IOException {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getAcksTo()).andReturn(epr);       
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
       
View Full Code Here

    }
   
    @Test
    public void testUpdateSourceSequence() throws SQLException {
        SourceSequence seq = control.createMock(SourceSequence.class);
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
        EasyMock.expect(seq.getExpires()).andReturn(null);
        EasyMock.expect(seq.getOfferingSequenceIdentifier()).andReturn(null);
        EasyMock.expect(seq.getEndpointIdentifier()).andReturn(CLIENT_ENDPOINT_ID);
       
View Full Code Here

    }

    @Test
    public void testGetDestinationSequences() throws SQLException, IOException {
       
        Identifier sid1 = null;
        Identifier sid2 = null;
       
        Collection<DestinationSequence> seqs =
            store.getDestinationSequences("unknown", ProtocolVariation.RM10WSA200408);
        assertEquals(0, seqs.size());
       
View Full Code Here

    }

    @Test
    public void testGetSourceSequences() throws SQLException {
       
        Identifier sid1 = null;
        Identifier sid2 = null;
       
        Collection<SourceSequence> seqs =
            store.getSourceSequences("unknown", ProtocolVariation.RM10WSA200408);
        assertEquals(0, seqs.size());
       
View Full Code Here

    }

    @Test
    public void testGetDestinationSequence() throws SQLException, IOException {
       
        Identifier sid1 = null;
        Identifier sid2 = null;
       
        DestinationSequence seq =
            store.getDestinationSequence(new Identifier(), ProtocolVariation.RM10WSA200408);
        assertNull(seq);

        try {
            sid1 = setupDestinationSequence("sequence1");
View Full Code Here

TOP

Related Classes of wycc.io.Token$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.