@Override protectedvoid runCases() {
setBreakpointsFromTestSource("EvalArgs.java", 1); // Run to breakpoint #1
jdb.command(JdbCommand.run());
final String argsMatchNoMethod = "Arguments match no method"; // verify that it works ok when arg types are the same as // the param types
evalShouldNotContain("EvalArgsTarg.ffboolean(EvalArgsTarg.jjboolean)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffbyte(EvalArgsTarg.jjbyte)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffchar(EvalArgsTarg.jjchar)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffdouble(EvalArgsTarg.jjdouble)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.fffloat(EvalArgsTarg.jjfloat)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffint(EvalArgsTarg.jjint)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.fflong(EvalArgsTarg.jjlong)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffshort(EvalArgsTarg.jjshort)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffintArray(EvalArgsTarg.jjintArray)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffjj1(EvalArgsTarg.myjj1)", argsMatchNoMethod);
// Provide a visual break in the output
jdb.command(JdbCommand.print("1"));
// Verify mixing primitive types works ok // These should work even though the arg types are // not the same because there is only one // method with each name.
evalShouldNotContain("EvalArgsTarg.ffbyte(EvalArgsTarg.jjint)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffchar(EvalArgsTarg.jjdouble)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffdouble(EvalArgsTarg.jjfloat)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.fffloat(EvalArgsTarg.jjshort)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffint(EvalArgsTarg.jjlong)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.fflong(EvalArgsTarg.jjchar)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.ffshort(EvalArgsTarg.jjbyte)", argsMatchNoMethod);
jdb.command(JdbCommand.print("1"));
// Verify that passing a subclass object works
evalShouldNotContain("EvalArgsTarg.ffjj1(EvalArgsTarg.myjj2)", argsMatchNoMethod);
evalShouldNotContain("EvalArgsTarg.myjj1.toString().equals(\"jj1name\")", argsMatchNoMethod);
jdb.command(JdbCommand.print("1"));
// Overloaded methods. These should pass // because there is an exact match.
evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjboolean)", argsMatchNoMethod);
jdb.command(JdbCommand.print("1"));
jdb.command(JdbCommand.print("\"These should fail with msg Arguments match multiple methods\""));
// These overload calls should fail because there // isn't an exact match and jdb isn't smart enough // to figure out which of several possibilities // should be called final String argsMatchMultipleMethods = "Arguments match multiple methods";
evalShouldContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjbyte)", argsMatchMultipleMethods);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.