1 21 package com.db4o.test; 22 23 import java.util.*; 24 25 26 29 public abstract class TestSuite { 30 31 protected Vector _testSuites; 32 33 public abstract Class [] tests(); 34 35 protected TestSuite suite(String name){ 36 try{ 37 Class clazz = Class.forName(name); 38 if(clazz != null){ 39 TestSuite ts = (TestSuite)clazz.newInstance(); 40 return ts; 41 } 42 }catch(Exception e){ 43 44 } 45 return null; 46 } 47 48 public boolean equals(Object obj){ 49 if(this == obj){ 50 return true; 51 } 52 if(obj == null){ 53 return false; 54 } 55 if(! (obj instanceof TestSuite)) { 56 return false; 57 } 58 return obj.getClass() == this.getClass(); 59 } 60 61 public void add(TestSuite suite){ 62 if(_testSuites == null){ 63 _testSuites = new Vector(); 64 } 65 if(_testSuites.contains(suite)){ 66 return; 67 } 68 _testSuites.addElement(suite); 69 } 70 71 } 72 | Popular Tags |