Package wycc.io

Examples of wycc.io.Token$Identifier


            }
            selectDestSequencesStmt.setString(1, endpointIdentifier);
           
            ResultSet res = selectDestSequencesStmt.executeQuery();
            while (res.next()) {
                Identifier sid = new Identifier();               
                sid.setValue(res.getString(1));
                EndpointReferenceType acksTo = RMUtils.createReference(res.getString(2))
                long lm = res.getLong(3);
                InputStream is = res.getBinaryStream(4);
                SequenceAcknowledgement ack = null;
                if (null != is) {
View Full Code Here


        control.verify();
    }
   
    @Test
    public void testGetSequence() {
        Identifier id = control.createMock(Identifier.class);
        String sid = "s1";
        EasyMock.expect(id.getValue()).andReturn(sid);
        control.replay();
        assertNull(destination.getSequence(id));
    }
View Full Code Here

            }
            selectSrcSequencesStmt.setString(1, endpointIdentifier);
            ResultSet res = selectSrcSequencesStmt.executeQuery();
           
            while (res.next()) {
                Identifier sid = new Identifier();
                sid.setValue(res.getString(1));
                long cmn = res.getLong(2);
                boolean lm = res.getBoolean(3);
                long lval = res.getLong(4);
                Date expiry = 0 == lval ? null : new Date(lval);
                String oidValue = res.getString(5);
                Identifier oi = null;
                if (null != oidValue) {
                    oi = new Identifier();
                    oi.setValue(oidValue);
                }                           
                SourceSequence seq = new SourceSequence(sid, expiry, oi, cmn, lm, protocol);
                seqs.add(seq);                         
            }
        } catch (SQLException ex) {
View Full Code Here

    @Test
    public void testAddRemoveSequence() {
        DestinationSequence ds = control.createMock(DestinationSequence.class);
        ds.setDestination(destination);
        EasyMock.expectLastCall();
        Identifier id = control.createMock(Identifier.class);
        EasyMock.expect(ds.getIdentifier()).andReturn(id).times(3);
        String sid = "s1";
        EasyMock.expect(id.getValue()).andReturn(sid).times(3);
        RMManager manager = control.createMock(RMManager.class);
        EasyMock.expect(rme.getManager()).andReturn(manager).times(2);       
        RMStore store = control.createMock(RMStore.class);
        EasyMock.expect(manager.getStore()).andReturn(store).times(2);
        store.createDestinationSequence(ds);
View Full Code Here

        Message message = setupMessage();
        RMProperties rmps = control.createMock(RMProperties.class);
        EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_INBOUND)).andReturn(rmps);
        SequenceType st = control.createMock(SequenceType.class);
        EasyMock.expect(rmps.getSequence()).andReturn(st);
        Identifier id = control.createMock(Identifier.class);
        EasyMock.expect(st.getIdentifier()).andReturn(id).times(2);
        EasyMock.expect(rme.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408).anyTimes();
        String sid = "sid";
        EasyMock.expect(id.getValue()).andReturn(sid);
        control.replay();
        try {
            destination.acknowledge(message);  
            fail("Expected SequenceFault not thrown.");
        } catch (SequenceFault ex) {
View Full Code Here

        Message message = setupMessage();
        RMProperties rmps = control.createMock(RMProperties.class);
        EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_INBOUND)).andReturn(rmps);
        SequenceType st = control.createMock(SequenceType.class);
        EasyMock.expect(rmps.getSequence()).andReturn(st);
        Identifier id = control.createMock(Identifier.class);
        EasyMock.expect(st.getIdentifier()).andReturn(id);
        DestinationSequence ds = control.createMock(DestinationSequence.class);
        EasyMock.expect(destination.getSequence(id)).andReturn(ds);
        long nr = 10;
        EasyMock.expect(st.getMessageNumber()).andReturn(nr)
View Full Code Here

        return dss;
    }

    private SourceSequence createTestSourceSequence(Source source, String sid,
                                                    EndpointReferenceType to, long[] acked) {
        Identifier identifier = RMUtils.getWSRMFactory().createIdentifier();
        identifier.setValue(sid);
        SourceSequence ss = new SourceSequence(identifier, null);
        ss.setSource(source);
        ss.setTarget(to);
        List<SequenceAcknowledgement.AcknowledgementRange> ranges =
            ss.getAcknowledgement().getAcknowledgementRange();
View Full Code Here

        return ss;
    }

    private DestinationSequence createTestDestinationSequence(Destination destination, String sid,
                                                              EndpointReferenceType to, long[] acked) {
        Identifier identifier = RMUtils.getWSRMFactory().createIdentifier();
        identifier.setValue(sid);
        DestinationSequence ds = new DestinationSequence(identifier, to, null, null);
        ds.setDestination(destination);

        List<SequenceAcknowledgement.AcknowledgementRange> ranges =
            ds.getAcknowledgment().getAcknowledgementRange();
View Full Code Here

        SequenceAcknowledgement ack2 = control.createMock(SequenceAcknowledgement.class);
        Collection<SequenceAcknowledgement> acks = new ArrayList<SequenceAcknowledgement>();
        acks.add(ack1);
        acks.add(ack2);
        EasyMock.expect(rmps.getAcks()).andReturn(acks);
        Identifier id1 = control.createMock(Identifier.class);
        EasyMock.expect(ack1.getIdentifier()).andReturn(id1);
        SourceSequence ss1 = control.createMock(SourceSequence.class);
        EasyMock.expect(source.getSequence(id1)).andReturn(ss1);
        ss1.setAcknowledged(ack1);
        EasyMock.expectLastCall();
        Identifier id2 = control.createMock(Identifier.class);
        EasyMock.expect(ack2.getIdentifier()).andReturn(id2);
        EasyMock.expect(source.getSequence(id2)).andReturn(null);
        control.replay();
        try {
            interceptor.processAcknowledgments(rme, rmps);
View Full Code Here

    public void testGenerateSequenceIdentifier() {
        RMManager mgr = control.createMock(RMManager.class);
        EasyMock.expect(rme.getManager()).andReturn(mgr);
        SequenceIdentifierGenerator generator = control.createMock(SequenceIdentifierGenerator.class);
        EasyMock.expect(mgr.getIdGenerator()).andReturn(generator);
        Identifier id = control.createMock(Identifier.class);
        EasyMock.expect(generator.generateSequenceIdentifier()).andReturn(id);
        control.replay();
        AbstractEndpoint tested = new AbstractEndpoint(rme);
        assertSame(id, tested.generateSequenceIdentifier());
        control.verify();
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.