Package org.openquark.cal.compiler

Examples of org.openquark.cal.compiler.CompilerMessage$Identifier


    }

    @Test
    public void testGetSourceSequence() throws SQLException, IOException {
       
        Identifier sid1 = null;
        Identifier sid2 = null;
       
        SourceSequence seq =
            store.getSourceSequence(new Identifier(), ProtocolVariation.RM10WSA200408);
        assertNull(seq);
       
        try {
            sid1 = setupSourceSequence("sequence1");
View Full Code Here


    }

    @Test
    public void testGetMessages() throws SQLException, IOException {
       
        Identifier sid1 = new Identifier();
        sid1.setValue("sequence1");
        Identifier sid2 = new Identifier();
        sid2.setValue("sequence2");
       
        Collection<RMMessage> out = store.getMessages(sid1, true);
        assertEquals(0, out.size());
        Collection<RMMessage> in = store.getMessages(sid1, false);
        assertEquals(0, out.size());
View Full Code Here

    }
   
    private Identifier setupDestinationSequence(String s) throws IOException, SQLException {
        DestinationSequence seq = control.createMock(DestinationSequence.class);
       
        Identifier sid = new Identifier();
        sid.setValue(s);
        EndpointReferenceType epr = RMUtils.createAnonymousReference();
       
        SequenceAcknowledgement ack = ack1;
        Long lmn = ZERO;
        
View Full Code Here

        return sid;
    }
   
    private Identifier setupSourceSequence(String s) throws SQLException {
        SourceSequence seq = control.createMock(SourceSequence.class);       
        Identifier sid = new Identifier();
        sid.setValue(s);     
           
        Date expiry = null;
        Identifier osid = null;
        Long cmn = ONE;
        boolean lm = false;
       
        if ("sequence2".equals(s)) {
            expiry = new Date(System.currentTimeMillis() + 3600 * 1000);
            osid = new Identifier();
            osid.setValue("offeringSequence");
            cmn = TEN;
            lm = true;           
        }
       
        EasyMock.expect(seq.getIdentifier()).andReturn(sid);
View Full Code Here

       
        return sid;
    }

    private void verifyDestinationSequence(String s, DestinationSequence seq) {
        Identifier sid = seq.getIdentifier();
        assertNotNull(sid);
        assertEquals(s, sid.getValue());
        if ("sequence1".equals(s)) {
            assertEquals(0, seq.getLastMessageNumber());
            SequenceAcknowledgement sa = seq.getAcknowledgment();
            assertNotNull(sa);
            verifyAcknowledgementRanges(sa.getAcknowledgementRange(), new long[]{1, 1});
View Full Code Here

            verifyAcknowledgementRanges(sa.getAcknowledgementRange(), new long[]{1, 1, 3, 10});
        }
    }
   
    private void verifySourceSequence(String s, SourceSequence seq) {
        Identifier sid = seq.getIdentifier();
        assertNotNull(sid);
        assertEquals(s, sid.getValue());
        if ("sequence1".equals(s)) {
            assertNull(seq.getExpires());
            assertEquals(1, seq.getCurrentMessageNr());
            assertFalse(seq.isLastMessage());
        } else if ("sequence2".equals(s)) {
View Full Code Here

        }
        if (messageNumber != null) {
            sequence.getMessageNumber();
            EasyMock.expectLastCall().andReturn(messageNumber);
        } else {
            Identifier id = createMock(Identifier.class);
            sequence.getIdentifier();
            EasyMock.expectLastCall().andReturn(id);
            id.getValue();
            EasyMock.expectLastCall().andReturn(sid);
            identifiers.add(id);
        }
        sequences.add(sequence);
        return sequence;
View Full Code Here

   
    private SourceSequence setUpSequence(String sid,
                                   Long[] messageNumbers,
                                   boolean[] isAcked) {
        SourceSequence sequence = createMock(SourceSequence.class);
        Identifier id = createMock(Identifier.class);
        sequence.getIdentifier();
        EasyMock.expectLastCall().andReturn(id);
        id.getValue();
        EasyMock.expectLastCall().andReturn(sid);
        identifiers.add(id);
        boolean includesAcked = false;
        for (int i = 0; isAcked != null && i < isAcked.length; i++) {
            sequence.isAcknowledged(messageNumbers[i]);
            EasyMock.expectLastCall().andReturn(isAcked[i]);
            if (isAcked[i]) {
                includesAcked = true;
            }
        }
        if (includesAcked) {
            // Will be called once or twice depending on whether any more
            // unacknowledged messages are left for this sequence
            sequence.getIdentifier();
            EasyMock.expectLastCall().andReturn(id).times(1, 2);

            // Would be called only when there are no more
            // unacknowledged messages left for this sequence
            id.getValue();
            EasyMock.expectLastCall().andReturn(sid).times(0, 1);

            RMStore store = createMock(RMStore.class);
            manager.getStore();
            EasyMock.expectLastCall().andReturn(store);
View Full Code Here

           
            List<CompilerMessage> compilerMessages = logger.getCompilerMessages(CompilerMessage.Severity.WARNING);
            if (!compilerMessages.isEmpty()) {
                int size = compilerMessages.size();
                for (int i = 0; i < size; i++) {
                    CompilerMessage message = compilerMessages.get(i);
                    System.err.println(message.toString());
                }
            }
        }

        return calServices;
View Full Code Here

    private static class MessageRenderer extends JLabel implements ListCellRenderer {
        private static final long serialVersionUID = 6898987006278555574L;

        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
           
            CompilerMessage message = (CompilerMessage)value;
           
            if(message.getSeverity() == CompilerMessage.Severity.FATAL) {
                setIcon(ERROR_ICON);
           
            } else if(message.getSeverity() == CompilerMessage.Severity.ERROR) {
                setIcon(ERROR_ICON);

            } else if(message.getSeverity() == CompilerMessage.Severity.WARNING) {
                setIcon(WARNING_ICON);
           
            } else if(message.getSeverity() == CompilerMessage.Severity.INFO) {
                setIcon(INFO_ICON);
            }
           
            setText(message.toString());
            return this;
        }
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.CompilerMessage$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.