ic, null);
String name2 = "someMethod";
Class[] types2 = new Class[] {int.class, Object.class};
InvocationConstraints constraints2 = new InvocationConstraints(
ic, null);
MethodDesc md1 = callConstructor(testCase, name1, types1,
constraints1);
MethodDesc md2 = callConstructor(testCase, name2, types2,
constraints2);
if (!md1.equals(md2)) {
throw new TestException(
"MethodDesc objects should be equal");
}
// 2
if ((testCase == case2arg) || (testCase == case3arg)) {
String name2diff = "anotherMethod";
md1 = callConstructor(testCase, name1, types1,
constraints1);
md2 = callConstructor(testCase, name2diff, types2,
constraints2);
if (md1.equals(md2)) {
throw new TestException(
"MethodDesc objects should not be equal");
}
}
// 3
if (testCase == case3arg) {
Class[] types2diff = new Class[] {long.class, Object.class};
md1 = callConstructor(testCase, name1, types1,
constraints1);
md2 = callConstructor(testCase, name2, types2diff,
constraints2);
if (md1.equals(md2)) {
throw new TestException(
"MethodDesc objects should not be equal");
}
}
// 4
if ((testCase == case2arg) || (testCase == case3arg)) {
InvocationConstraint ic2diff = Delegation.NO;
InvocationConstraints constraints2diff =
new InvocationConstraints(ic2diff, null);
Class[] types2diff = new Class[] {long.class, Object.class};
md1 = callConstructor(testCase, name1, types1,
constraints1);
md2 = callConstructor(testCase, name2, types2,
constraints2diff);
if (md1.equals(md2)) {
throw new TestException(
"MethodDesc objects should not be equal");
}
}
// 5
if ((testCase == case2arg) || (testCase == case3arg)) {
md1 = callConstructor(case1arg, name1, types1,
constraints1);
md2 = callConstructor(testCase, name2, types2,
constraints2);
if (md1.equals(md2) || md2.equals(md1)) {
throw new TestException(
"MethodDesc objects should not be equal");
}
}
// 6
if (testCase == case3arg) {
md1 = callConstructor(case2arg, name1, types1,
constraints1);
md2 = callConstructor(testCase, name2, types2,
constraints2);
if (md1.equals(md2) || md2.equals(md1)) {
throw new TestException(
"MethodDesc objects should not be equal");
}
}
}