blob: b1fa18ccf074279dc70043e356b9ccbdaeb920cc [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2002, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.debug.tests.eval;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
public class TypeHierarchy_32_2 extends Tests {
/**
* Constructor for TypeHierarchy.
* @param name
*/
public TypeHierarchy_32_2(String name) {
super(name);
}
public void init() throws Exception {
initializeFrame("EvalTypeHierarchyTests", 32, 2, 2);
}
protected void end() throws Exception {
destroyFrame();
}
public void testEvalNestedTypeTest_m1() throws Throwable {
try {
init();
IValue value = eval("m1()");
String typeName = value.getReferenceTypeName();
assertEquals("m1 : wrong type : ", "int", typeName);
int intValue = ((IJavaPrimitiveValue)value).getIntValue();
assertEquals("m1 : wrong result : ", 11, intValue);
} finally {;
end();
}
}
public void testEvalNestedTypeTest_m2() throws Throwable {
try {
init();
IValue value = eval("m2()");
String typeName = value.getReferenceTypeName();
assertEquals("m2 : wrong type : ", "int", typeName);
int intValue = ((IJavaPrimitiveValue)value).getIntValue();
assertEquals("m2 : wrong result : ", 22, intValue);
} finally {;
end();
}
}
public void testEvalNestedTypeTest_s2() throws Throwable {
try {
init();
IValue value = eval("s2()");
String typeName = value.getReferenceTypeName();
assertEquals("s2 : wrong type : ", "int", typeName);
int intValue = ((IJavaPrimitiveValue)value).getIntValue();
assertEquals("s2 : wrong result : ", 9, intValue);
} finally {;
end();
}
}
}