@Test public void testMainUsage() { ServiceAgentGenerator.main(new String[0]); assertTrue(("" + standardError.toString()).contains("usage:")); assertEquals("", standardOut.toString()); }
public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " signs long, but only " + argv[0].length() + " given"); return; } try { ServiceAgentImpl agent = ServiceAgentImpl.createServiceAgent(ServiceNameVersion.fromString(argv[0]), argv[1]); System.out.print(agent.toXmlString()); } catch (Exception e) { System.err.println("unable to generate new agent: " + e); } }
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " signs long, but only " + argv[0].length() + " given"); return; } try { ServiceAgentImpl agent = ServiceAgentImpl.createServiceAgent(ServiceNameVersion.fromString(argv[0]), argv[1]); System.out.print(agent.toXmlString()); } catch (Exception e) { System.err.println("unable to generate new agent: " + e); } } }
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " signs long, but only " + argv[0].length() + " given"); return; } try { ServiceAgentImpl agent = ServiceAgentImpl.createServiceAgent(ServiceNameVersion.fromString(argv[0]), argv[1]); System.out.print(agent.toXmlString()); } catch (Exception e) { System.err.println("unable to generate new agent: " + e); } }  }
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " signs long, but only " + argv[0].length() + " given"); return; } try { ServiceAgentImpl agent = ServiceAgentImpl.createServiceAgent(ServiceNameVersion.fromString(argv[0]), argv[1]); System.out.print(agent.toXmlString()); } catch (Exception e) { System.err.println("unable to generate new agent: " + e); } }  static void main(String argv[]); }
ServiceAgentGenerator { public static void main(String argv[]) { if (argv.length != 2) { System.err.println( "usage: java i5.las2peer.tools.ServiceAgentGenerator [service class]@[service version] [passphrase]"); return; } else if (argv[0].length() < PW_MIN_LENGTH) { System.err.println("the password needs to be at least " + PW_MIN_LENGTH + " signs long, but only " + argv[0].length() + " given"); return; } try { ServiceAgentImpl agent = ServiceAgentImpl.createServiceAgent(ServiceNameVersion.fromString(argv[0]), argv[1]); System.out.print(agent.toXmlString()); } catch (Exception e) { System.err.println("unable to generate new agent: " + e); } }  static void main(String argv[]);  }