Package org.lightfish.presentation.publication

Examples of org.lightfish.presentation.publication.BrowserWindow


    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        AsyncContext startAsync = request.startAsync();
        String channel = extractChannel(request.getRequestURI());
        events.fire(new BrowserWindow(startAsync, channel));
        LOG.fine("Event sent for channel " + channel);
    }
View Full Code Here


    }

    @Test
    public void singleChannelNofified() {
        final String escalationChannel = "duke";
        BrowserWindow window = mock(BrowserWindow.class);

        Writer writer = mock(Writer.class);
        when(window.getWriter()).thenReturn(writer);

        Escalation escalation = new Escalation();
        escalation.setChannel(escalationChannel);
        when(window.getChannel()).thenReturn(escalationChannel);

        this.cut.onEscalationBrowserRequest(window);
        this.cut.addEscalation(escalation);
        verify(window, never()).send();
        this.cut.notifyEscalationListeners();
View Full Code Here

     * channel, the "broadcast" channel should be notified.
     */
    @Test
    public void broadcastChannelNofified() {
        final String escalationChannel = "duke";
        BrowserWindow window = mock(BrowserWindow.class);
        when(window.getChannel()).thenReturn("");
        Escalation escalation = new Escalation();
        escalation.setChannel(escalationChannel);
        this.cut.onEscalationBrowserRequest(window);
        this.cut.addEscalation(escalation);
        verify(window, never()).send();
View Full Code Here

        verify(window).send();
    }

    @Test
    public void nothingToSay() {
        BrowserWindow window = mock(BrowserWindow.class);
        when(window.getChannel()).thenReturn("does-not-matter");
        this.cut.onEscalationBrowserRequest(window);
        verify(window, never()).send();
        this.cut.notifyEscalationListeners();
        verify(window).nothingToSay();
        verify(window, never()).send();
View Full Code Here

TOP

Related Classes of org.lightfish.presentation.publication.BrowserWindow

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.