01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: package de.uka.ilkd.key.java;
09:
10: import java.io.File;
11:
12: import de.uka.ilkd.key.proof.ProofAggregate;
13: import de.uka.ilkd.key.util.HelperClassForTests;
14: import junit.framework.TestCase;
15:
16: public class TestJavaCardDLJavaExtensions extends TestCase {
17:
18: private HelperClassForTests helper = new HelperClassForTests();
19:
20: public static final String testpath = System
21: .getProperty("key.home")
22: + File.separator
23: + "examples"
24: + File.separator
25: + "_testcase"
26: + File.separator
27: + "javacardDLExtensions"
28: + File.separator;
29:
30: public TestJavaCardDLJavaExtensions() {
31:
32: }
33:
34: public void testTypeNotInScopeShouldNotBeFound() {
35: try {
36: helper.parseThrowException(new File(testpath
37: + "typeResolutionInMethodFrame.key"));
38: } catch (Throwable t) {
39: return;
40: }
41: fail("Something with type resolution in method frames is corrupt. "
42: + "The type Test should not be found in the default scope as it is "
43: + "declared inside package test.");
44: }
45:
46: public void testMethodFrameRedirectsScope() {
47: ProofAggregate pa = null;
48: try {
49: pa = helper.parseThrowException(new File(testpath
50: + "typeResolutionInMethodFrame2.key"));
51: } catch (Throwable t) {
52: fail("Something with type resolution in method frames is corrupt. "
53: + "The type Test should be found as the scope to look for "
54: + "is redirected to test.Test");
55: }
56: }
57: }
|