Coverage Report - org.seasar.teeda.core.mock.MockLifecycleImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
MockLifecycleImpl
75%
12/16
N/A
1.111
 
 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 javax.faces.FacesException;
 19  
 import javax.faces.context.FacesContext;
 20  
 import javax.faces.event.PhaseListener;
 21  
 
 22  
 import org.seasar.framework.util.ArrayUtil;
 23  
 
 24  
 public class MockLifecycleImpl extends MockLifecycle {
 25  
 
 26  2684
     private PhaseListener[] phaseListeners_ = new PhaseListener[0];
 27  
 
 28  2684
     public MockLifecycleImpl() {
 29  2684
     }
 30  
 
 31  
     public void addPhaseListener(PhaseListener listener) {
 32  1346
         phaseListeners_ = (PhaseListener[]) ArrayUtil.add(phaseListeners_,
 33  
                 listener);
 34  1346
     }
 35  
 
 36  
     public void execute(FacesContext context) throws FacesException {
 37  0
     }
 38  
 
 39  
     public PhaseListener[] getPhaseListeners() {
 40  7
         return phaseListeners_;
 41  
     }
 42  
 
 43  
     public void removePhaseListener(PhaseListener listener) {
 44  0
         phaseListeners_ = (PhaseListener[]) ArrayUtil.remove(phaseListeners_,
 45  
                 listener);
 46  0
     }
 47  
 
 48  
     public void render(FacesContext context) throws FacesException {
 49  0
     }
 50  
 
 51  
     public PhaseListener[] clearAllPhaseListener() {
 52  
         try {
 53  8
             return phaseListeners_;
 54  
         } finally {
 55  8
             setupDefaultPhaseListener();
 56  
         }
 57  
     }
 58  
 
 59  
     public void setupDefaultPhaseListener() {
 60  8
         phaseListeners_ = new PhaseListener[0];
 61  8
     }
 62  
 
 63  
     public void setupDefaultPhaseListener(PhaseListener[] listeners) {
 64  7
         phaseListeners_ = listeners;
 65  7
     }
 66  
 
 67  
 }