Clover Coverage Report - kns-test 2.0.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
12   58   2   6
0   30   0.17   1
2     1  
2    
 
  PromptBeforeValidationContinuationBaseTest       Line # 28 10 0% 1 11 0% 0.0
  PromptBeforeValidationContinuationBaseTest.TestPreRules       Line # 30 2 0% 1 3 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2006-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16    package org.kuali.rice.kns.rule;
17   
18    import org.junit.Test;
19    import org.kuali.rice.kns.document.Document;
20    import org.kuali.rice.kns.document.MaintenanceDocument;
21    import org.kuali.rice.kns.rule.event.PromptBeforeValidationEvent;
22    import org.kuali.rice.kns.rules.PromptBeforeValidationBase;
23    import org.kuali.rice.kns.rules.PromptBeforeValidationBase.ContextSession;
24    import org.kuali.test.KNSTestCase;
25   
26    import static org.junit.Assert.assertEquals;
27   
 
28    public class PromptBeforeValidationContinuationBaseTest extends KNSTestCase {
29   
 
30    private class TestPreRules extends PromptBeforeValidationBase {
 
31  0 toggle @Override
32    public boolean doPrompts(Document document) {
33  0 MaintenanceDocument maintenanceDocument = (MaintenanceDocument) document;
34  0 return false;
35    }
36   
37    }
38   
 
39  0 toggle @Test public void test() {
40   
41  0 TestPreRules preRules = new TestPreRules();
42   
43  0 PromptBeforeValidationEvent event = new PromptBeforeValidationEvent("", "", null);
44   
45  0 ContextSession contextSession = preRules.new ContextSession("test", event);
46   
47  0 contextSession.askQuestion("q1", "this is q1");
48  0 contextSession.setAttribute("t1", "test1");
49  0 contextSession.setAttribute("t2", "test2");
50  0 contextSession.setAttribute("t3", "test3");
51   
52  0 assertEquals("testing retrieve", "test1", contextSession.getAttribute("t1"));
53  0 assertEquals("testing retrieve", "test2", contextSession.getAttribute("t2"));
54  0 assertEquals("testing retrieve", "test3", contextSession.getAttribute("t3"));
55   
56    }
57   
58    }