Package org.cyclopsgroup.jmxterm

Examples of org.cyclopsgroup.jmxterm.Session


    {
        if ( report && stopAfter == 0 )
        {
            throw new IllegalArgumentException( "When --report is sepcified, --stopafter(-s) must be specificed" );
        }
        Session session = getSession();
        String domain = DomainCommand.getDomainName( null, session );
        if ( domain == null )
        {
            throw new IllegalStateException( "Please specify a domain using domain command first." );
        }
        String beanName = BeanCommand.getBeanName( null, domain, session );
        if ( beanName == null )
        {
            throw new IllegalStateException( "Please specify a bean using bean command first." );
        }

        final ObjectName name = new ObjectName( beanName );
        final MBeanServerConnection con = session.getConnection().getServerConnection();
        final Output output;
        if ( report )
        {
            output = new ReportOutput( session );
        }
View Full Code Here


     */
    @Override
    public void execute()
        throws IOException
    {
        Session session = getSession();

        session.output.printMessage( "following domains are available" );
        for ( String domain : getCandidateDomains( session ) )
        {
            session.output.println( domain );
View Full Code Here

        command.setBean( "a:type=x" );
        command.setType( "a" );
        final MBeanServerConnection con = context.mock( MBeanServerConnection.class );
        final MBeanInfo beanInfo = context.mock( MBeanInfo.class );
        final MBeanAttributeInfo attributeInfo = context.mock( MBeanAttributeInfo.class );
        Session session = new MockSession( output, con );
        context.checking( new Expectations()
        {
            {
                atLeast( 1 ).of( con ).getMBeanInfo( new ObjectName( "a:type=x" ) );
                will( returnValue( beanInfo ) );
View Full Code Here

        command.setType( "o" );
        final MBeanServerConnection con = context.mock( MBeanServerConnection.class );
        final MBeanInfo beanInfo = context.mock( MBeanInfo.class );
        final MBeanOperationInfo opInfo = context.mock( MBeanOperationInfo.class );
        final MBeanParameterInfo paramInfo = context.mock( MBeanParameterInfo.class );
        Session session = new MockSession( output, con );
        context.checking( new Expectations()
        {
            {
                atLeast( 1 ).of( con ).getMBeanInfo( new ObjectName( "a:type=x" ) );
                will( returnValue( beanInfo ) );
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

     */
    @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.Session

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.