RequestReflectionTest.java revision 2362
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4425840
* @author Robert Field
*
* @run build TestScaffold VMConnection TargetListener TargetAdapter
* @run compile -g RequestReflectionTest.java
* @run main RequestReflectionTest
*
* @summary RequestReflectionTest checks to see that reflective
* accessors on EventRequests return what they are given.
*/
/********** target program **********/
class RequestReflectionTarg {
int foo = 9;
(new RequestReflectionTarg()).bar();
}
void bar() {
++foo;
}
}
/********** test program **********/
public class RequestReflectionTest extends TestScaffold {
super(args);
}
}
/********** test core **********/
/*
* Get to the top of main():
*/
throw new Exception("test error: cannot find field foo");
}
throw new Exception("test error: should be one bar()");
}
throw new Exception(
"test error: should be one java.lang.Exception");
}
throw new Exception(
"RequestReflectionTest fail: exceptions do not match " +
}
throw new Exception(
"RequestReflectionTest fail: size does not match " +
}
throw new Exception(
"RequestReflectionTest fail: depth does not match " +
}
throw new Exception(
"RequestReflectionTest fail: wrong suspend policy " +
sr.suspendPolicy());
}
throw new Exception(
"RequestReflectionTest fail: should be enabled");
}
throw new Exception(
"RequestReflectionTest fail: size does not match " +
}
throw new Exception(
"RequestReflectionTest fail: depth does not match " +
}
throw new Exception(
"RequestReflectionTest fail: wrong suspend policy " +
sr.suspendPolicy());
}
throw new Exception(
"RequestReflectionTest fail: should not be enabled");
}
throw new Exception(
"RequestReflectionTest fail: fields do not match " +
}
throw new Exception(
"RequestReflectionTest fail: wrong suspend policy " +
awr.suspendPolicy());
}
throw new Exception(
"RequestReflectionTest fail: should not be enabled");
}
throw new Exception(
"RequestReflectionTest fail: methodss do not match " +
}
throw new Exception(
"RequestReflectionTest fail: wrong suspend policy " +
bpr.suspendPolicy());
}
throw new Exception(
"RequestReflectionTest fail: should be enabled");
}
throw new Exception(
"RequestReflectionTest fail: not java.lang.Exception " +
}
throw new Exception(
"RequestReflectionTest fail: wrong suspend policy " +
exr.suspendPolicy());
}
throw new Exception(
"RequestReflectionTest fail: should not be enabled");
}
println("RequestReflectionTest: passed");
}
}