@Test public void testExecute_noRoboconfVersion() throws Exception { InstallTargetCommand itc = new InstallTargetCommand(); ByteArrayOutputStream os = new ByteArrayOutputStream(); itc.out = new PrintStream( os, true, "UTF-8" ); itc.targetName = "openstack"; itc.execute(); Assert.assertTrue( os.toString( "UTF-8" ).contains( "the Roboconf version" )); }
@Override public Object execute() throws Exception { SupportedTarget st = SupportedTarget.which( this.targetName ); if( st == null ) { this.out.println( "Unknown target: " + this.targetName + ". Make sure it is correct or install it manually." ); } else if( this.roboconfVersion == null ) { this.out.println( "Error: the Roboconf version could not be determined." ); } else for( String cmd : st.findCommands( this.roboconfVersion )) { this.logger.fine( "Executing " + cmd + "..." ); this.out.println( "Executing " + cmd + "..." ); this.session.execute( cmd ); } return null; }
InstallTargetCommand implements Action { @Override public Object execute() throws Exception { SupportedTarget st = SupportedTarget.which( this.targetName ); if( st == null ) { this.out.println( "Unknown target: " + this.targetName + ". Make sure it is correct or install it manually." ); } else if( this.roboconfVersion == null ) { this.out.println( "Error: the Roboconf version could not be determined." ); } else for( String cmd : st.findCommands( this.roboconfVersion )) { this.logger.fine( "Executing " + cmd + "..." ); this.out.println( "Executing " + cmd + "..." ); this.session.execute( cmd ); } return null; } }
InstallTargetCommand implements Action { @Override public Object execute() throws Exception { SupportedTarget st = SupportedTarget.which( this.targetName ); if( st == null ) { this.out.println( "Unknown target: " + this.targetName + ". Make sure it is correct or install it manually." ); } else if( this.roboconfVersion == null ) { this.out.println( "Error: the Roboconf version could not be determined." ); } else for( String cmd : st.findCommands( this.roboconfVersion )) { this.logger.fine( "Executing " + cmd + "..." ); this.out.println( "Executing " + cmd + "..." ); this.session.execute( cmd ); } return null; } InstallTargetCommand(); }
InstallTargetCommand implements Action { @Override public Object execute() throws Exception { SupportedTarget st = SupportedTarget.which( this.targetName ); if( st == null ) { this.out.println( "Unknown target: " + this.targetName + ". Make sure it is correct or install it manually." ); } else if( this.roboconfVersion == null ) { this.out.println( "Error: the Roboconf version could not be determined." ); } else for( String cmd : st.findCommands( this.roboconfVersion )) { this.logger.fine( "Executing " + cmd + "..." ); this.out.println( "Executing " + cmd + "..." ); this.session.execute( cmd ); } return null; } InstallTargetCommand(); @Override Object execute(); }
InstallTargetCommand implements Action { @Override public Object execute() throws Exception { SupportedTarget st = SupportedTarget.which( this.targetName ); if( st == null ) { this.out.println( "Unknown target: " + this.targetName + ". Make sure it is correct or install it manually." ); } else if( this.roboconfVersion == null ) { this.out.println( "Error: the Roboconf version could not be determined." ); } else for( String cmd : st.findCommands( this.roboconfVersion )) { this.logger.fine( "Executing " + cmd + "..." ); this.out.println( "Executing " + cmd + "..." ); this.session.execute( cmd ); } return null; } InstallTargetCommand(); @Override Object execute();  }