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: //
09: //
10:
11: package de.uka.ilkd.key.rule.soundness;
12:
13: import junit.framework.TestCase;
14: import de.uka.ilkd.key.rule.NoPosTacletApp;
15: import de.uka.ilkd.key.rule.TacletForTests;
16:
17: /**
18: * class tests the creation of proof obligations of taclets
19: */
20: public class TestProofObligationCreation extends TestCase {
21:
22: public TestProofObligationCreation(String name) {
23: super (name);
24: }
25:
26: public void setUp() {
27: TacletForTests.setStandardFile(TacletForTests.testRules);
28: TacletForTests.parse();
29: }
30:
31: // Currently only the creation of proof obligations is performed,
32: // the result is not checked
33: public void testCreation() {
34: createPO("testPO0", 1);
35: createPO("testPO1", 1);
36: createPO("testPO2", 2);
37: createPO("testPO3", 2);
38: createPO("testPO4", 1);
39: createPO("testPO5", 9);
40: }
41:
42: private void createPO(String p_tacletName,
43: int p_expectedNumberOfPOParts) {
44: TacletForTests.getJavaInfo().readJavaBlock("{}");
45: NoPosTacletApp app = TacletForTests.getRules().lookup(
46: p_tacletName);
47: POBuilder pob = new POBuilder(app, TacletForTests.services());
48: pob.build();
49:
50: assertTrue("Expected the proof obligation to consist of "
51: + p_expectedNumberOfPOParts + ", but got "
52: + pob.getNumberOfPOParts() + " parts.",
53: p_expectedNumberOfPOParts == pob.getNumberOfPOParts());
54: }
55:
56: }
|