@Test public void testPrintHelp() throws Exception { Jar jar = newCapsuleJar() .setAttribute("Application-Class", "com.acme.Foo") .setAttribute("Application-Version", "12.34") .addEntry("foo.jar", emptyInputStream()); props.setProperty("capsule.help", ""); Class<?> capsuleClass = loadCapsule(jar); setProperties(capsuleClass, props); StringPrintStream out = setSTDERR(capsuleClass, new StringPrintStream()); Object capsule = newCapsule(capsuleClass); boolean found = runActions(capsule, null); String res = out.toString(); assert_().that(found).isTrue(); assert_().that(res).contains("USAGE: "); }
void printHelp(List<String> args) { printHelp(wrapper); }
Capsule implements Runnable, InvocationHandler { void printHelp(List<String> args) { printHelp(wrapper); } }
Capsule implements Runnable, InvocationHandler { void printHelp(List<String> args) { printHelp(wrapper); } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); }
Capsule implements Runnable, InvocationHandler { void printHelp(List<String> args) { printHelp(wrapper); } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); static final void main(String[] args); @SuppressWarnings({"BroadCatchBlock", "UnusedAssignment"}) static int main0(String[] args0); static void premain(String agentArgs, Instrumentation inst); static Object getCapsule(String capletClassName); boolean isAgent(); @Override final void run(); @Override Object invoke(Object proxy, Method method, Object[] args); @Override final int hashCode(); @Override final boolean equals(Object obj); @Override String toString(); }
Capsule implements Runnable, InvocationHandler { void printHelp(List<String> args) { printHelp(wrapper); } @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) protected  Capsule(Path jarFile); @SuppressWarnings("LeakingThisInConstructor") protected  Capsule(Capsule pred); static final void main(String[] args); @SuppressWarnings({"BroadCatchBlock", "UnusedAssignment"}) static int main0(String[] args0); static void premain(String agentArgs, Instrumentation inst); static Object getCapsule(String capletClassName); boolean isAgent(); @Override final void run(); @Override Object invoke(Object proxy, Method method, Object[] args); @Override final int hashCode(); @Override final boolean equals(Object obj); @Override String toString(); static final String VERSION; }