Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../img/srcFileCovDistChart7.png 74% of files have more coverage
25   88   12   8.33
6   56   0.48   3
3     4  
1    
 
  TestingProofCheckerFactoryImpl       Line # 37 25 12 64.7% 0.64705884
 
  (7)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.bo.test;
17   
18    import java.lang.reflect.InvocationTargetException;
19   
20    import org.qedeq.base.io.Version;
21    import org.qedeq.base.test.DynamicGetter;
22    import org.qedeq.kernel.bo.KernelContext;
23    import org.qedeq.kernel.bo.common.QedeqBo;
24    import org.qedeq.kernel.bo.logic.ProofCheckerFactoryImpl;
25    import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker0Impl;
26    import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker1Impl;
27    import org.qedeq.kernel.bo.logic.proof.checker.ProofChecker2Impl;
28    import org.qedeq.kernel.bo.logic.proof.common.ProofChecker;
29   
30   
31   
32    /**
33    * Extra testing factory implementation for {@link ProofChecker}s.
34    *
35    * @author Michael Meyling
36    */
 
37    public class TestingProofCheckerFactoryImpl extends ProofCheckerFactoryImpl {
38   
 
39  72 toggle public ProofChecker createProofChecker(final Version ruleVersion) {
40  72 if (ruleVersion.equals("0.00.00")) {
41  0 return new ProofChecker0Impl() {
42   
43    };
44  72 } else if (ruleVersion.equals("0.01.00")) {
45  39 return new ProofChecker1Impl() {
 
46  1121 toggle protected void setLocationWithinModule(final String locationWithinModule) {
47  1121 getCurrentContext().setLocationWithinModule(locationWithinModule);
48  1121 try {
49  1121 System.out.println("testing context " + locationWithinModule);
50  1121 QedeqBo qedeq = KernelContext.getInstance().getQedeqBo(getCurrentContext().getModuleLocation());
51  1121 DynamicGetter.get(qedeq.getQedeq(), getCurrentContext().getLocationWithinModule());
52    } catch (RuntimeException e) {
53  0 System.out.println(getCurrentContext().getLocationWithinModule());
54  0 throw e;
55    } catch (IllegalAccessException e) {
56  0 throw new RuntimeException(e);
57    } catch (InvocationTargetException e) {
58  0 throw new RuntimeException(e);
59    }
60    }
61   
62    };
63  33 } else if (ruleVersion.equals("0.02.00")) {
64  33 return new ProofChecker2Impl() {
 
65  1229 toggle protected void setLocationWithinModule(final String locationWithinModule) {
66  1229 getCurrentContext().setLocationWithinModule(locationWithinModule);
67  1229 try {
68  1229 System.out.println("testing context " + locationWithinModule);
69  1229 QedeqBo qedeq = KernelContext.getInstance().getQedeqBo(getCurrentContext().getModuleLocation());
70  1229 DynamicGetter.get(qedeq.getQedeq(), getCurrentContext().getLocationWithinModule());
71    } catch (RuntimeException e) {
72  0 System.out.println(getCurrentContext().getLocationWithinModule());
73  0 throw e;
74    } catch (IllegalAccessException e) {
75  0 throw new RuntimeException(e);
76    } catch (InvocationTargetException e) {
77  0 throw new RuntimeException(e);
78    }
79    }
80   
81    };
82    }
83    // not found, so we take the best one we have
84  0 return new ProofChecker2Impl();
85    }
86   
87   
88    }