1 20 package org.apache.cactus.internal.server; 21 22 import junit.framework.Assert; 23 import junit.framework.Test; 24 25 import org.apache.commons.logging.Log; 26 import org.apache.commons.logging.LogFactory; 27 28 36 public class ServerTestCaseCaller extends Assert 37 { 38 41 private Log logger; 42 43 46 private Test delegatedTest; 47 48 51 private Test wrappedTest; 52 53 58 public ServerTestCaseCaller(Test theDelegatedTest, Test theWrappedTest) 59 { 60 if (theDelegatedTest == null) 61 { 62 throw new IllegalStateException ( 63 "The test object passed must not be null"); 64 } 65 66 setDelegatedTest(theDelegatedTest); 67 setWrappedTest(theWrappedTest); 68 } 69 70 73 public void setWrappedTest(Test theWrappedTest) 74 { 75 this.wrappedTest = theWrappedTest; 76 } 77 78 81 public Test getWrappedTest() 82 { 83 return this.wrappedTest; 84 } 85 86 89 public void setDelegatedTest(Test theDelegatedTest) 90 { 91 this.delegatedTest = theDelegatedTest; 92 } 93 94 97 public Test getDelegatedTest() 98 { 99 return this.delegatedTest; 100 } 101 102 106 public void runBareInit() 107 { 108 if (getLogger() == null) 113 { 114 setLogger(LogFactory.getLog(getDelegatedTest().getClass())); 115 } 116 } 117 118 122 private Log getLogger() 123 { 124 return this.logger; 125 } 126 127 130 private void setLogger(Log theLogger) 131 { 132 this.logger = theLogger; 133 } 134 } 135 | Popular Tags |