/**
* @test
* @bug 4390869
* @bug 4460328
* @summary Test the new SourceDebugExtension facility
*
* @author Robert Field
*
* @library ..
* @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
* @run compile MangleTest.java
* @run compile -g onion/pickle/Mangle.java
* @run main MangleTest
*/
super(args);
}
testSetUp();
}
/********** test set-up **********/
op + "Mangle.class"),
"Mangle.sde"));
}
/********** test assist **********/
int expectedLinenumber) throws Exception {
} else {
" expected sourceName " + expectedSourceName +
" got - " + sourceName);
}
} else {
" expected sourcePath " + expectedSourcePath +
" got - " + sourcePath);
}
if (ln == expectedLinenumber) {
} else {
" expected line number " + expectedLinenumber +
" got - " + ln);
}
}
int expectedLinenumber) throws Exception {
" sourceName: " + sourceName);
} else {
" expected sourceName " + expectedSourceName +
" got " + sourceName);
}
" sourcePath: " + sourcePath);
} else {
" expected sourcePath " + expectedSourcePath +
" got " + sourcePath);
}
if (ln == expectedLinenumber) {
" line number: " + ln);
} else {
" expected line number " + expectedLinenumber +
" got " + ln);
}
}
}
" expected: " + line);
}
}
}
return result;
}
return result;
}
/********** test core **********/
/*
* Get to the top of main()
* to determine targetClass
*/
// ref type source name
} else {
}
// ref type source names /paths
} else {
failure("FAIL: unexpected ref type Java sourceNames - " +
}
} else {
failure("FAIL: unexpected ref type XYZ sourceNames - " +
}
} else {
failure("FAIL: unexpected ref type null sourceNames - " +
}
} else {
failure("FAIL: unexpected ref type Rats sourceNames - " +
}
} else {
failure("FAIL: unexpected ref type Java sourcePaths - " +
}
} else {
failure("FAIL: unexpected ref type XYZ sourcePaths - " +
}
} else {
failure("FAIL: unexpected ref type null sourcePaths - " +
}
"bleep:bleep:Incl.rats"))) {
} else {
failure("FAIL: unexpected ref type Rats sourcePaths - " +
}
println("allLineLocations() is OK");
} else {
}
println("allLineLocations(\"bogus\") is OK");
} else {
}
println("allLineLocations(null) is OK");
} else {
}
}
failure("FAIL: locations should not match - " +
}
}
}
failure("FAIL: locations should not match - " +
}
failure("FAIL: xyz locations should not match - " +
}
failure("FAIL: xyz locations should not match - " +
}
failure("FAIL: xyz locations should not match - " +
}
failure("FAIL: rats locations should not match - " +
}
failure("FAIL: rats locations should not match - " +
}
failure("FAIL: rats locations should not match - " +
}
println("*** Java");
}
println("*** XYZ");
}
println("*** Rats");
}
"Incl.xyz",
"Incl.xyz",
"Incl.xyz",
"Mangle.java",
"Incl.xyz",
"Mangle.rats",
"Mangle.xyz",
"database14", 210);
"Mangle.xyz",
"database14", 210);
"Mangle.xyz",
"database14", 210);
"Mangle.java",
"Mangle.xyz",
"database14", 210);
"Incl.rats",
"bleep:bleep:Incl.rats", 1112);
"Mangle.xyz",
"database14", 218);
"Mangle.xyz",
"database14", 218);
"Mangle.xyz",
"database14", 218);
"Mangle.java",
"Mangle.xyz",
"database14", 218);
"Incl.rats",
"bleep:bleep:Incl.rats", 1112);
/*
* resume the target listening for events
*/
/*
* deal with results of test
* if anything has called failure("foo") testFailed will be true
*/
if (!testFailed) {
println("MangleTest: passed");
} else {
throw new Exception("MangleTest: failed");
}
}
}