Coverage Report - biz.xsoftware.examples.advanced.SysUnderTestImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
SysUnderTestImpl
100%
7/7
N/A
1
SysUnderTestImpl$TaskStartedListener
100%
7/7
N/A
1
 
 1  
 /*
 2  
  * Created on Jun 28, 2004
 3  
  *
 4  
  * To change the template for this generated file go to
 5  
  * Window - Preferences - Java - Code Generation - Code and Comments
 6  
  */
 7  
 package biz.xsoftware.examples.advanced;
 8  
 
 9  
 
 10  
 /**
 11  
  * The SysUnderTest here is a WebStore or something which needs
 12  
  * to authorize purchases.
 13  
  */
 14  1
 public class SysUnderTestImpl implements SysUnderTest {
 15  
 
 16  
         private TaskRecordService msgSystem;
 17  
         private TaskSystemService taskSystem;
 18  
         
 19  
         /**
 20  
          * @showcode
 21  
          */
 22  1
         public SysUnderTestImpl(TaskRecordService msgSystem, TaskSystemService t) {
 23  1
                 this.msgSystem = msgSystem;
 24  1
                 this.taskSystem = t;
 25  1
         }
 26  
         /**
 27  
          * @showcode
 28  
          */
 29  
         public void sendUserMailWhenTaskStarted(String id, String taskName) {
 30  1
                 taskSystem.addScheduleListener(new TaskStartedListener(id, taskName));
 31  1
         }
 32  
 
 33  
         private class TaskStartedListener implements ScheduleListener {
 34  
 
 35  
                 private String name;
 36  
                 private String userId;
 37  
                 /**
 38  
                  * @showcode
 39  
                  */
 40  1
                 public TaskStartedListener(String userId, String name) {
 41  1
                         this.name = name;
 42  1
                         this.userId = userId;
 43  1
                 }
 44  
                 /**
 45  
                  * @showcode
 46  
                  * @see biz.xsoftware.examples.advanced.ScheduleListener#eventStarted(java.lang.String)
 47  
                  */
 48  
                 public void eventStarted(String title) {
 49  1
                         User u = msgSystem.getUser(userId);
 50  
                         
 51  1
                         u.addTaskDone(name);
 52  1
                 }
 53  
         }
 54  
 
 55  
 }