Coverage report

  %line %branch
org.demosys.task.MemoryTaskService
22% 
33% 

 1  
 /*
 2  
  * Demosys.
 3  
  *
 4  
  * Terms of license - http://opensource.org/licenses/apachepl.php
 5  
  */
 6  
 package org.demosys.task;
 7  
 import java.util.HashMap;
 8  
 /**
 9  
  */
 10  24
 public class MemoryTaskService implements TaskService {
 11  24
     private HashMap memory = new HashMap();
 12  
 
 13  
     public synchronized void newTask(TaskView task)
 14  
         throws CreationTaskException {
 15  0
         if (memory.containsKey(task.getTitle())) {
 16  0
             throw new CreationTaskException("Existe deja en Base");
 17  
         }
 18  
 
 19  
         //if (task.getTitle().length()<2) {
 20  
         //    throw new CreateTaskException("task.new.error.title");
 21  
         // }
 22  0
         memory.put(task.getTitle(), task.clone());
 23  0
     }
 24  
 
 25  
 
 26  
     public synchronized TaskView getTask(String title)
 27  
         throws ModificationTaskException {
 28  0
         if (false == memory.containsKey(title)) {
 29  0
             throw new ModificationTaskException("Inconnue en base");
 30  
         }
 31  
 
 32  0
         return (TaskView)memory.get(title);
 33  
     }
 34  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.