Package org.cyclopsgroup.jmxterm

Examples of org.cyclopsgroup.jmxterm.MockSession


                one( con ).invoke( new ObjectName( "a:type=x" ), "exe",
                                   new Object[] { 33 }, new String[] { "int" } );
                will( returnValue( "bingo" ) );
            }
        } );
        command.setSession( new MockSession( output, con ) );
        command.execute();
        context.assertIsSatisfied();
        assertEquals( "bingo", output.toString().trim() );
    }
View Full Code Here


     */
    @Test
    public void testExecute()
        throws Exception
    {
        MockSession session = new MockSession( output, null );
        command.setSession( session );
        command.execute();
        assertFalse( session.isConnected() );
    }
View Full Code Here

     */
    @Test
    public void testExecute()
        throws Exception
    {
        Session session = new MockSession( output, null );
        command.setSession( session );
        command.execute();
        assertFalse( session.isConnected() );
        assertTrue( session.isClosed() );
    }
View Full Code Here

                    will( returnValue( true ) );
                    one( con ).getAttribute( new ObjectName( expectedBean ), attribute );
                    will( returnValue( expectedValue ) );
                }
            } );
            command.setSession( new MockSession( output, con ) );
            command.execute();
            context.assertIsSatisfied();
            assertEquals( expectedValue.toString(), output.toString().trim() );
        }
        catch ( JMException e )
View Full Code Here

                        with(equal(objectName)),
                        with(any(NotificationListener.class)));
            }
        });

        MockSession session = new MockSession(output, con);
        subscribeCommand.setSession( session );
        subscribeCommand.execute();
        assertEquals( 1, SubscribeCommand.getListeners().size() );

        unsubscribeCommand.setSession( session );
View Full Code Here

                atLeast(1).of(notification).getMessage();
                will(returnValue("qwerty"));
            }
        });
        subscribeCommand.setSession(new MockSession(output, con));
        subscribeCommand.execute();
        assertEquals( 1, SubscribeCommand.getListeners().size() );

        NotificationListener notificationListener = SubscribeCommand.getListeners().get( objectName );
        assertNotNull( notificationListener );
View Full Code Here

     */
    @Test( expected = IllegalArgumentException.class )
    public void testExecuteWithInvalidVerbose()
        throws Exception
    {
        Session session = new MockSession( output, null );
        command.setVerboseLevel( "xyz" );
        command.setSession( session );
        command.execute();
    }
View Full Code Here

    @Test
    public void testExecuteWithoutUrl()
        throws Exception
    {
        StringWriter output = new StringWriter();
        Session session = new MockSession( output, null );
        command.setSession( session );
        command.execute();
        assertEquals( "id,service:jmx:rmi:///jndi/rmi://localhost:9991/jmxrmi", output.toString().trim() );
    }
View Full Code Here

    @Test
    public void testExecuteWithUrl()
        throws Exception
    {
        command.setUrl( "xyz.cyclopsgroup.org:12345" );
        Session session = new MockSession( new StringWriter(), null );
        session.disconnect();
        command.setSession( session );
        command.execute();
        assertTrue( session.isConnected() );
    }
View Full Code Here

TOP

Related Classes of org.cyclopsgroup.jmxterm.MockSession

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.