1 64 65 package com.jcorporate.expresso.services.test; 66 67 import com.jcorporate.expresso.core.dbobj.Schema; 68 import junit.framework.TestResult; 69 import junit.framework.TestSuite; 70 71 import java.util.Enumeration ; 72 import java.util.Vector ; 73 74 75 81 public class ControllerTestSuite 82 extends TestSuite { 83 private Vector v = null; 84 85 public ControllerTestSuite() 86 throws Exception { 87 TestSystemInitializer.setUp(); 88 v = new Vector (); 89 } 90 91 98 public void addSchemaDependency(String s) 99 throws Exception { 100 Schema sch = (Schema) (Class.forName(s).newInstance()); 101 v.add(sch); 102 SchemaManager.addReference(sch); 103 } 104 105 111 public void addReadOnlySchemaDependency(String s) 112 throws Exception { 113 addReadOnlySchemaDependency(Class.forName(s)); 114 } 115 116 121 public void addReadOnlySchemaDependency(Class c) 122 throws Exception { 123 Schema sch = (Schema) (c.newInstance()); 124 v.add(sch); 125 SchemaManager.addReadOnlyReference(sch); 126 } 127 128 131 public void run(TestResult result) { 132 super.run(result); 133 cleanUp(); 134 } 135 136 public void cleanUp() { 137 for (Enumeration e = v.elements(); e.hasMoreElements();) { 138 Schema s = (Schema) e.nextElement(); 139 SchemaManager.removeReference(s); 140 } 141 } 142 } | Popular Tags |