Examples of History


Examples of org.apache.felix.gogo.shell.History

        TestCase.assertFalse(hi.hasNext());
    }

    @Test
    public void test_fill_history() {
        final History his = new History();

        // NOTE: Assumes a fixed history size of 100
        for (int i = 0; i < 100; i++) {
            his.append("cmd" + i);
        }

        Iterator<String> hi = his.getHistory();
        for (int i = 0; i < 100; i++) {
            TestCase.assertEquals("cmd" + i, hi.next());
        }
        TestCase.assertFalse(hi.hasNext());
    }
View Full Code Here

Examples of org.apache.felix.gogo.shell.History

        TestCase.assertFalse(hi.hasNext());
    }

    @Test
    public void test_overflow_history() {
        final History his = new History();

        // NOTE: Assumes a fixed history size of 100
        for (int i = -20; i < 100; i++) {
            his.append("cmd" + i);
        }

        Iterator<String> hi = his.getHistory();
        for (int i = 0; i < 100; i++) {
            TestCase.assertEquals("cmd" + i, hi.next());
        }
        TestCase.assertFalse(hi.hasNext());
    }
View Full Code Here

Examples of org.apache.geronimo.twiddle.console.History

            line = null;
        }
       
        // Update history
        if (line != null && updateHistory && isHistoryEnabled()) {
            History h = getHistory();
            h.add(line);
        }
       
        return line;
    }
View Full Code Here

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.History

        addElementProcessor(new ActionName());
        addElementProcessor(new AddMessage());
        addElementProcessor(new AddWarning());
        addElementProcessor(new BlockDefine());
        addElementProcessor(new BlockUse());
        addElementProcessor(new History());
        addElementProcessor(new Collection());
        addElementProcessor(new Commit());
        addElementProcessor(new ContentTag());
        addElementProcessor(new CountElements());
        addElementProcessor(new Diagnostics());
View Full Code Here

Examples of org.apache.lenya.cms.repository.History

    protected void initParameters() {
        super.initParameters();
        Document sourceDoc = getSourceDocument();
        if (sourceDoc != null) {
            try {
                History history = sourceDoc.getRepositoryNode().getHistory();

                int[] numbers = history.getRevisionNumbers();
                Revision[] revisions = new Revision[numbers.length];
                for (int i = 0; i < numbers.length; i++) {
                    revisions[i] = history.getRevision(numbers[i]);
                }
                setParameter("revisions", revisions);

                Boolean canRollback = Boolean.valueOf(WorkflowUtil.canInvoke(this.manager,
                        getDocumentFactory().getSession(), getLogger(), sourceDoc, getEvent()));
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.History

       
        assertStanzas(stanzas, 0);
    }

    public void test150SecondsStanzas() throws Exception {
        List<Stanza> stanzas = history.createStanzas(RECEIVER_OCCUPANT, true, new History(null, null, 150, null));
       
        // 2 stanzas + subject should fit in 150 seconds
        assertStanzas(stanzas, 3);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.History

        assertStanzas(stanzas, 3);
    }

   
    public void testSince5minutesStanzas() throws Exception {
        List<Stanza> stanzas = history.createStanzas(RECEIVER_OCCUPANT, true, new History(null, null, null, createTimestamp(5)));
       
        // 2 stanzas + subject should fit in 150 seconds
        assertStanzas(stanzas, 6);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.History

                new Occupant(OCCUPANT2_JID, "nick2", Affiliation.None, Role.Participant));
        room.getHistory().append(StanzaBuilder.createMessageStanza(OCCUPANT2_JID, ROOM1_JID, MessageStanzaType.GROUPCHAT, null, "Body3").build(),
                new Occupant(OCCUPANT2_JID, "nick2", Affiliation.None, Role.Participant));
       
        // now, let user 1 enter room
        enterRoom(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, null, new History(2, null, null, null), false);

        Stanza stanza = occupant1Queue.getNext();
        // first stanza should be room presence
        assertNotNull(stanza);
        assertEquals("presence", stanza.getName());
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.History

                startInnerElement("subject").addText(SUBJECT).endInnerElement().build(),
                FROM_OCCUPANT);
    }

    public void testGetAllStanzas() throws Exception {
        List<Stanza> stanzas = history.createStanzas(RECEIVER_OCCUPANT, true, new History(null, null, null, null));
       
        assertStanzas(stanzas, DiscussionHistory.DEFAULT_HISTORY_SIZE);
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.History

        assertStanzas(stanzas, DiscussionHistory.DEFAULT_HISTORY_SIZE);
    }

   
    public void testThreeStanzas() throws Exception {
        List<Stanza> stanzas = history.createStanzas(RECEIVER_OCCUPANT, true, new History(3, null, null, null));
        assertStanzas(stanzas, 3);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.