Coverage Report - org.seasar.teeda.core.mock.MockLifecycleFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
MockLifecycleFactory
88%
7/8
N/A
1
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
 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,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.mock;
 17  
 
 18  
 import java.util.HashMap;
 19  
 import java.util.Iterator;
 20  
 import java.util.Map;
 21  
 
 22  
 import javax.faces.lifecycle.Lifecycle;
 23  
 import javax.faces.lifecycle.LifecycleFactory;
 24  
 
 25  
 public class MockLifecycleFactory extends LifecycleFactory {
 26  
 
 27  1339
     private Map lifecycles_ = new HashMap();
 28  
 
 29  1339
     public MockLifecycleFactory() {
 30  1339
         addLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE,
 31  
                 new MockLifecycleImpl());
 32  1339
     }
 33  
 
 34  
     public void addLifecycle(String lifecycleId, Lifecycle lifecycle) {
 35  2679
         lifecycles_.put(lifecycleId, lifecycle);
 36  2679
     }
 37  
 
 38  
     public Lifecycle getLifecycle(String lifecycleId) {
 39  9
         return (Lifecycle) lifecycles_.get(lifecycleId);
 40  
     }
 41  
 
 42  
     public Iterator getLifecycleIds() {
 43  0
         return lifecycles_.keySet().iterator();
 44  
     }
 45  
 
 46  
 }