Package org.fcrepo.server.journal.readerwriter.multicast.rmi

Examples of org.fcrepo.server.journal.readerwriter.multicast.rmi.RmiTransport


    }

    @Test(expected = JournalException.class)
    public void testNoHostParameter() throws JournalException {
        parameters.remove(RmiTransport.PARAMETER_HOST_NAME);
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here


    }

    @Test(expected = JournalException.class)
    public void testInvalidHostParameter() throws JournalException {
        parameters.put(RmiTransport.PARAMETER_HOST_NAME, "BogusHost");
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here

    }

    @Test(expected = JournalException.class)
    public void testInvalidPortParameter() throws JournalException {
        parameters.put(RmiTransport.PARAMETER_PORT_NUMBER, "BogusPort");
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here

    }

    @Test(expected = JournalException.class)
    public void testNoServiceNameParameter() throws JournalException {
        parameters.remove(RmiTransport.PARAMETER_SERVICE_NAME);
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here

        new RmiTransport(parameters, CRUCIAL, parent);
    }

    @Test(expected = JournalException.class)
    public void testNoRegistry() throws JournalException {
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here

    @Test
    public void testOpenCloseSequenceCalls() throws JournalException,
            RemoteException {
        MockRmiJournalReceiver receiver = new MockRmiJournalReceiver();
        RmiTransport transport =
                new RmiTransport(parameters, CRUCIAL, parent, receiver);

        transport.openFile("someHash", "aFileName", new Date());
        assertEquals(1, receiver.howManyCallsToOpenFile());

        transport.closeFile();
        assertEquals(1, receiver.howManyCallsToClosefile());
    }
View Full Code Here

    @Ignore
    @Test(expected = JournalException.class)
    public void testNoSuchService() throws JournalException, IOException {
        startMockRmiJournalReceiver();
        parameters.put(RmiTransport.PARAMETER_SERVICE_NAME, "BogusService");
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here

    @Ignore
    @Test
    public void testSuccessfulConnection() throws JournalException, IOException {
        startMockRmiJournalReceiver();
        new RmiTransport(parameters, CRUCIAL, parent);
    }
View Full Code Here

    @Ignore
    @Test
    public void testOpenCloseShutdownSequence() throws JournalException,
            IOException {
        startMockRmiJournalReceiver();
        RmiTransport transport = new RmiTransport(parameters, CRUCIAL, parent);

        transport.openFile("someHash", "aFileName", new Date());
        assertCorrectNumberOfCalls(1, 0, 0);

        transport.closeFile();
        assertCorrectNumberOfCalls(1, 1, 1);

        transport.shutdown();
        assertCorrectNumberOfCalls(1, 1, 1);
    }
View Full Code Here

    @Test
    public void testWritesWithSmallBuffer() throws JournalException,
            IOException, XMLStreamException {
        startMockRmiJournalReceiver();
        parameters.put(RmiTransport.PARAMETER_BUFFER_SIZE, "100");
        RmiTransport transport = new RmiTransport(parameters, CRUCIAL, parent);

        transport.openFile("someHash", "aFileName", new Date());
        assertCorrectNumberOfCalls(1, 1, 0);

        XMLEventFactory factory = XMLEventFactory.newInstance();
        QName name1 = new QName("junkyElement1");
        QName name2 = new QName("junkyElement12");
        transport.getWriter()
                .add(factory.createStartElement(name1, null, null));
        transport.getWriter().add(factory.createEndElement(name1, null));
        assertCorrectNumberOfCalls(1, 1, 0);

        transport.getWriter()
                .add(factory.createStartElement(name2, null, null));
        transport.getWriter().add(factory.createEndElement(name2, null));

        transport.closeFile();
        assertCorrectNumberOfCalls(1, 3, 1);

        transport.shutdown();
        assertCorrectNumberOfCalls(1, 3, 1);
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.journal.readerwriter.multicast.rmi.RmiTransport

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.