Coverage report

  %line %branch
net.sf.infrared.aspects.jdbc.SqlExecuteContext
0% 
0% 

 1  
 /* 
 2  
  * Copyright 2005 Tavant Technologies and Contributors
 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, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  * 
 16  
  *
 17  
  *
 18  
  * Original Author:  binil.thomas (Tavant Technologies)
 19  
  * Contributor(s):   -;
 20  
  *
 21  
  */
 22  
 package net.sf.infrared.aspects.jdbc;
 23  
 
 24  
 import java.util.Collections;
 25  
 import java.util.List;
 26  
 
 27  
 import net.sf.infrared.base.model.ExecutionContext;
 28  
 
 29  
 /**
 30  
  * 
 31  
  * @author binil.thomas
 32  
  */
 33  
 public class SqlExecuteContext implements ExecutionContext {
 34  
 	private SqlContext parent;
 35  
 	
 36  0
 	public SqlExecuteContext(SqlContext parent) {
 37  0
 		if (parent == null) {
 38  0
 			throw new IllegalArgumentException("parent SqlContext cannot be null");
 39  
 		}
 40  0
 		this.parent = parent;
 41  0
 	}
 42  
 	
 43  0
 	public SqlExecuteContext(String name, String layer) {
 44  
 		
 45  0
 		SqlContext parentContext = new SqlContext(name, layer);
 46  0
 		this.parent = parentContext;
 47  0
 		this.parent.addChild(class="keyword">this);
 48  
 		
 49  0
 	}
 50  
 	
 51  
 	// The string returned is stored in the DB as the name.
 52  
 	public String getName() {
 53  0
 		return (parent == null) ? class="keyword">null : parent.getName();		
 54  
 	}
 55  
 	
 56  
 	
 57  
 	public ExecutionContext getParent() {
 58  0
 		return parent;
 59  
 	}
 60  
 
 61  
 	public String getLayer() {
 62  0
         return "SQL"; //@TODO make constant!
 63  
 	}
 64  
 
 65  
 	public List getChildren() {
 66  0
 		return Collections.EMPTY_LIST;
 67  
 	}
 68  
 
 69  
 	public void addChild(ExecutionContext arg0) {
 70  0
 		throw new UnsupportedOperationException(); // @TODO for now
 71  
 	}
 72  
 	
 73  
 	public String toString() {
 74  
 		//return "[JDBC] EXECUTE (" + ((SqlContext) getParent()).getSql() + ")";
 75  0
         return parent.getSql() + " [SQL] EXECUTE ";
 76  
 	}
 77  
 	
 78  
 	public boolean equals(Object o) {
 79  0
 		if (o == null) {
 80  0
 			return false;
 81  
 		}
 82  
 		
 83  0
 		if (o == this) {
 84  0
 			return true;
 85  
 		}
 86  
 		
 87  0
         if (!(o instanceof SqlExecuteContext)) {
 88  0
             return false;
 89  
         }
 90  
 		
 91  0
 		SqlExecuteContext other = (SqlExecuteContext) o;
 92  0
 		return other.parent.equals(parent);
 93  
 	}
 94  
 
 95  
 	public int hashCode() {
 96  0
 		return parent.hashCode();
 97  
 	}
 98  
 }

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