Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/ConstantField/values001.java
41159 views
/*1* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.jdi.ConstantField;2425import nsk.share.*;26import nsk.share.jdi.*;2728import com.sun.jdi.*;29import com.sun.jdi.request.*;3031import java.io.*;32import java.util.*;3334/**35* Test checks up static fields of JDI interfaces according to specification36*/37public class values001 {3839private static int exitStatus;40private static Log log;4142public static void main(String argv[]) {43System.exit(Consts.JCK_STATUS_BASE + run(argv, System.out));44}4546public static int run(String argv[], PrintStream out) {4748exitStatus = Consts.TEST_PASSED;4950ArgumentHandler argHandler = new ArgumentHandler(argv);51log = new Log(out, argHandler);5253execTest();5455log.display("execTest finished. exitStatus = " + exitStatus);5657return exitStatus;58}5960private static void execTest() {61exitStatus = Consts.TEST_PASSED;6263if (ClassType.INVOKE_SINGLE_THREADED != 1) {64log.complain("***wrong value*** : ClassType.INVOKE_SINGLE_THREADED = "65+ ClassType.INVOKE_SINGLE_THREADED);66exitStatus = Consts.TEST_FAILED;67}6869if (ObjectReference.INVOKE_NONVIRTUAL != 2) {70log.complain("***wrong value*** : ObjectReference.INVOKE_NONVIRTUAL = "71+ ObjectReference.INVOKE_NONVIRTUAL);72exitStatus = Consts.TEST_FAILED;73}7475if (ObjectReference.INVOKE_SINGLE_THREADED != 1) {76log.complain("***wrong value*** : ObjectReference.INVOKE_SINGLE_THREADED = "77+ ObjectReference.INVOKE_SINGLE_THREADED);78exitStatus = Consts.TEST_FAILED;79}8081if (ThreadReference.THREAD_STATUS_MONITOR != 3) {82log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_MONITOR = "83+ ThreadReference.THREAD_STATUS_MONITOR);84exitStatus = Consts.TEST_FAILED;85}8687if (ThreadReference.THREAD_STATUS_NOT_STARTED != 5) {88log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_NOT_STARTED = "89+ ThreadReference.THREAD_STATUS_NOT_STARTED);90exitStatus = Consts.TEST_FAILED;91}9293if (ThreadReference.THREAD_STATUS_RUNNING != 1) {94log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_RUNNING = "95+ ThreadReference.THREAD_STATUS_RUNNING);96exitStatus = Consts.TEST_FAILED;97}9899if (ThreadReference.THREAD_STATUS_SLEEPING != 2) {100log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_SLEEPING = "101+ ThreadReference.THREAD_STATUS_SLEEPING);102exitStatus = Consts.TEST_FAILED;103}104105if (ThreadReference.THREAD_STATUS_UNKNOWN != -1) {106log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_UNKNOWN = "107+ ThreadReference.THREAD_STATUS_UNKNOWN);108exitStatus = Consts.TEST_FAILED;109}110111if (ThreadReference.THREAD_STATUS_WAIT != 4) {112log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_WAIT = "113+ ThreadReference.THREAD_STATUS_WAIT);114exitStatus = Consts.TEST_FAILED;115}116117if (ThreadReference.THREAD_STATUS_ZOMBIE != 0) {118log.complain("***wrong value*** : ThreadReference.THREAD_STATUS_ZOMBIE = "119+ ThreadReference.THREAD_STATUS_ZOMBIE);120exitStatus = Consts.TEST_FAILED;121}122123124// VirtualMachine125if (VirtualMachine.TRACE_ALL != 16777215) {126log.complain("***wrong value*** : VirtualMachine.TRACE_ALL = "127+ VirtualMachine.TRACE_ALL);128exitStatus = Consts.TEST_FAILED;129}130131if (VirtualMachine.TRACE_EVENTS != 4) {132log.complain("***wrong value*** : VirtualMachine.TRACE_EVENTS = "133+ VirtualMachine.TRACE_EVENTS);134exitStatus = Consts.TEST_FAILED;135}136137if (VirtualMachine.TRACE_NONE != 0) {138log.complain("***wrong value*** : VirtualMachine.TRACE_NONE = "139+ VirtualMachine.TRACE_NONE);140exitStatus = Consts.TEST_FAILED;141}142143if (VirtualMachine.TRACE_OBJREFS != 16) {144log.complain("***wrong value*** : VirtualMachine.TRACE_OBJREFS = "145+ VirtualMachine.TRACE_OBJREFS);146exitStatus = Consts.TEST_FAILED;147}148149if (VirtualMachine.TRACE_RECEIVES != 2) {150log.complain("***wrong value*** : VirtualMachine.TRACE_RECEIVES = "151+ VirtualMachine.TRACE_RECEIVES);152exitStatus = Consts.TEST_FAILED;153}154155if (VirtualMachine.TRACE_REFTYPES != 8) {156log.complain("***wrong value*** : VirtualMachine.TRACE_REFTYPES = "157+ VirtualMachine.TRACE_REFTYPES);158exitStatus = Consts.TEST_FAILED;159}160161if (VirtualMachine.TRACE_SENDS != 1) {162log.complain("***wrong value*** : VirtualMachine.TRACE_SENDS = "163+ VirtualMachine.TRACE_SENDS);164exitStatus = Consts.TEST_FAILED;165}166167168if (EventRequest.SUSPEND_ALL != 2) {169log.complain("***wrong value*** : EventRequest.SUSPEND_ALL = "170+ EventRequest.SUSPEND_ALL);171exitStatus = Consts.TEST_FAILED;172}173174if (EventRequest.SUSPEND_EVENT_THREAD != 1) {175log.complain("***wrong value*** : EventRequest.SUSPEND_EVENT_THREAD = "176+ EventRequest.SUSPEND_EVENT_THREAD);177exitStatus = Consts.TEST_FAILED;178}179180if (EventRequest.SUSPEND_NONE != 0) {181log.complain("***wrong value*** : EventRequest.SUSPEND_NONE = "182+ EventRequest.SUSPEND_NONE);183exitStatus = Consts.TEST_FAILED;184}185186187if (StepRequest.STEP_INTO != 1) {188log.complain("***wrong value*** : StepRequest.STEP_INTO = "189+ StepRequest.STEP_INTO);190exitStatus = Consts.TEST_FAILED;191}192193if (StepRequest.STEP_LINE != -2) {194log.complain("***wrong value*** : StepRequest.STEP_LINE = "195+ StepRequest.STEP_LINE);196exitStatus = Consts.TEST_FAILED;197}198199if (StepRequest.STEP_MIN != -1) {200log.complain("***wrong value*** : StepRequest.STEP_MIN = "201+ StepRequest.STEP_MIN);202exitStatus = Consts.TEST_FAILED;203}204205if (StepRequest.STEP_OUT != 3) {206log.complain("***wrong value*** : StepRequest.STEP_OUT = "207+ StepRequest.STEP_OUT);208exitStatus = Consts.TEST_FAILED;209}210211if (StepRequest.STEP_OVER != 2) {212log.complain("***wrong value*** : StepRequest.STEP_OVER = "213+ StepRequest.STEP_OVER);214exitStatus = Consts.TEST_FAILED;215}216log.display("");217}218219}220221222