Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 32276 invoked from network); 11 Aug 2004 00:37:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Aug 2004 00:37:42 -0000 Received: (qmail 54281 invoked by uid 500); 11 Aug 2004 00:37:39 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 54161 invoked by uid 500); 11 Aug 2004 00:37:37 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 54147 invoked by uid 500); 11 Aug 2004 00:37:37 -0000 Received: (qmail 54144 invoked by uid 99); 11 Aug 2004 00:37:37 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Tue, 10 Aug 2004 17:37:34 -0700 Received: (qmail 32109 invoked by uid 1510); 11 Aug 2004 00:37:33 -0000 Date: 11 Aug 2004 00:37:33 -0000 Message-ID: <20040811003733.32108.qmail@minotaur.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb build.xml X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N arminw 2004/08/10 17:37:33 Modified: src/test/org/apache/ojb/junit JUnitExtensions.java OJBTestCase.java PBTestCase.java src/test/org/apache/ojb/otm CopyTest.java DependentTests.java LockTestBase.java MtoNTest.java MultipleConnectionsTest.java OtmExamples.java PerformanceTest.java SwizzleTests.java src/test/org/apache/ojb/performance PerfMain.java PerfTest.java src/test/org/apache/ojb/soda SodaExamples.java src/test/org/apache/ojb OJB-logging.properties OJB.properties repository.dtd repository.xml repository_database.xml repository_internal.xml repository_junit.xml repository_junit_cache.xml src/xdoclet/test/xdoclet/modules/ojb/tests TestObjectCache.java . build.xml Added: src/test/org/apache/ojb repository_perf_test.xml Log: initial version of OJB 1.1 Revision Changes Path 1.3 +2 -2 db-ojb/src/test/org/apache/ojb/junit/JUnitExtensions.java Index: JUnitExtensions.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/junit/JUnitExtensions.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JUnitExtensions.java 12 Jul 2004 16:26:27 -0000 1.2 +++ JUnitExtensions.java 11 Aug 2004 00:37:30 -0000 1.3 @@ -65,7 +65,7 @@ *
Category: Test *
Not guaranteed to be thread safe. */ - public static class MultiThreadedTestCase extends TestCase + public static class MultiThreadedTestCase extends OJBTestCase { /** * The threads that are executing. 1.6 +16 -3 db-ojb/src/test/org/apache/ojb/junit/OJBTestCase.java Index: OJBTestCase.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/junit/OJBTestCase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- OJBTestCase.java 24 Jun 2004 13:43:41 -0000 1.5 +++ OJBTestCase.java 11 Aug 2004 00:37:30 -0000 1.6 @@ -1,6 +1,8 @@ package org.apache.ojb.junit; import junit.framework.TestCase; +import org.apache.ojb.broker.OJB; +import org.apache.ojb.broker.PersistenceBrokerFactory; /** * Extension of the JUnit test class. @@ -13,6 +15,17 @@ private static final String SKIP_STR = "OJB.skip.issues"; private static final String SKIP_DEFAULT_VALUE = "false"; + /* + setup OJB main class instance + */ + public static OJB ojb; + static + { + ojb = new OJB(); + // TODO: fix this!! This makes old tests compatible with 1.1 version + PersistenceBrokerFactory.setOjb(ojb); + } + public OJBTestCase() { } @@ -59,7 +72,7 @@ */ public boolean ojbSkipKnownIssueProblem() { - return skipKnownIssueProblem(null); + return ojbSkipKnownIssueProblem(null); } /** @@ -67,7 +80,7 @@ * a release was made. To enable the skipped tests set a system property 'skip.issues' * to false. */ - public boolean skipKnownIssueProblem(String message) + public boolean ojbSkipKnownIssueProblem(String message) { String result = SKIP_DEFAULT_VALUE; boolean skip = false; 1.4 +2 -1 db-ojb/src/test/org/apache/ojb/junit/PBTestCase.java Index: PBTestCase.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/junit/PBTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- PBTestCase.java 22 Jun 2004 18:16:22 -0000 1.3 +++ PBTestCase.java 11 Aug 2004 00:37:30 -0000 1.4 @@ -2,6 +2,7 @@ import org.apache.ojb.broker.PersistenceBroker; import org.apache.ojb.broker.PersistenceBrokerFactory; +import org.apache.ojb.broker.OJB; /** * A base class for PB-api based test cases. 1.11 +15 -7 db-ojb/src/test/org/apache/ojb/otm/CopyTest.java Index: CopyTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/CopyTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- CopyTest.java 22 Jun 2004 18:16:24 -0000 1.10 +++ CopyTest.java 11 Aug 2004 00:37:30 -0000 1.11 @@ -15,11 +15,17 @@ * limitations under the License. */ -import junit.framework.TestCase; -import org.apache.ojb.broker.*; +import org.apache.ojb.broker.BidirectionalAssociationObjectA; +import org.apache.ojb.broker.BidirectionalAssociationObjectB; +import org.apache.ojb.broker.Identity; +import org.apache.ojb.broker.Mammal; +import org.apache.ojb.broker.PersistenceBroker; +import org.apache.ojb.broker.PersistenceBrokerFactory; +import org.apache.ojb.broker.Reptile; +import org.apache.ojb.broker.Zoo; +import org.apache.ojb.junit.OJBTestCase; import org.apache.ojb.odmg.shared.TestClassA; import org.apache.ojb.odmg.shared.TestClassB; -import org.apache.ojb.odmg.shared.TestClassB; import org.apache.ojb.otm.copy.MetadataObjectCopyStrategy; import org.apache.ojb.otm.copy.ObjectCopyStrategy; import org.apache.ojb.otm.copy.ReflectiveObjectCopyStrategy; @@ -33,7 +39,7 @@ * Date: Jul 7, 2003 * Time: 2:10:49 PM */ -public class CopyTest extends TestCase +public class CopyTest extends OJBTestCase { private static Class CLASS = CopyTest.class; private PersistenceBroker m_pb; @@ -52,18 +58,20 @@ super(name); } - public void setUp() throws LockingException + public void setUp() throws Exception { - m_pb = PersistenceBrokerFactory.defaultPersistenceBroker(); + super.setUp(); + m_pb = PersistenceBrokerFactory.defaultPersistenceBroker(); _kit = TestKit.getTestInstance(); _conn = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey()); } - public void tearDown() throws LockingException + public void tearDown() throws Exception { m_pb.close(); _conn.close(); _conn = null; + super.tearDown(); } public static void main(String[] args) 1.7 +8 -7 db-ojb/src/test/org/apache/ojb/otm/DependentTests.java Index: DependentTests.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/DependentTests.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DependentTests.java 12 Apr 2004 16:32:42 -0000 1.6 +++ DependentTests.java 11 Aug 2004 00:37:30 -0000 1.7 @@ -1,36 +1,37 @@ package org.apache.ojb.otm; import java.util.Iterator; -import junit.framework.TestCase; + import org.apache.ojb.broker.Identity; import org.apache.ojb.broker.PersistenceBrokerFactory; import org.apache.ojb.broker.query.Criteria; import org.apache.ojb.broker.query.Query; import org.apache.ojb.broker.query.QueryFactory; +import org.apache.ojb.junit.OJBTestCase; import org.apache.ojb.otm.core.Transaction; -import org.apache.ojb.otm.lock.LockingException; -public class DependentTests extends TestCase +public class DependentTests extends OJBTestCase { - private static Class CLASS = DependentTests.class; private TestKit _kit; private OTMConnection _conn; - public void setUp() throws LockingException + public void setUp() throws Exception { + super.setUp(); _kit = TestKit.getTestInstance(); _conn = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey()); } - public void tearDown() throws LockingException + public void tearDown() throws Exception { _conn.close(); _conn = null; + super.tearDown(); } public static void main(String[] args) { - String[] arr = {CLASS.getName()}; + String[] arr = {DependentTests.class.getName()}; junit.textui.TestRunner.main(arr); } 1.4 +23 -22 db-ojb/src/test/org/apache/ojb/otm/LockTestBase.java Index: LockTestBase.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/LockTestBase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LockTestBase.java 28 Jun 2003 13:06:59 -0000 1.3 +++ LockTestBase.java 11 Aug 2004 00:37:31 -0000 1.4 @@ -5,17 +5,17 @@ * based on the ODMG locking documentation */ -import junit.framework.TestCase; import org.apache.ojb.broker.Article; import org.apache.ojb.broker.PersistenceBrokerFactory; +import org.apache.ojb.junit.OJBTestCase; import org.apache.ojb.otm.core.Transaction; -import org.apache.ojb.otm.lock.ObjectLock; import org.apache.ojb.otm.lock.LockingException; +import org.apache.ojb.otm.lock.ObjectLock; import org.apache.ojb.otm.lock.isolation.TransactionIsolation; import org.apache.ojb.otm.lock.wait.NoWaitStrategy; import org.apache.ojb.otm.lock.wait.TimeoutStrategy; -public abstract class LockTestBase extends TestCase +public abstract class LockTestBase extends OJBTestCase { protected TestKit _kit; protected OTMConnection _conn1; @@ -32,8 +32,9 @@ protected abstract TransactionIsolation newIsolation(); - public void setUp() + public void setUp() throws Exception { + super.setUp(); _kit = TestKit.getTestInstance(); _kit.setLockWaitStrategy(new NoWaitStrategy()); _isolation = newIsolation(); @@ -55,7 +56,25 @@ { ex.printStackTrace(); } + } + + public void tearDown() throws Exception + { + try + { + _tx1.rollback(); + _conn1.close(); + _conn1 = null; + _tx2.rollback(); + _conn2.close(); + _conn2 = null; + } + catch (Throwable t) + { + } + _kit.setLockWaitStrategy(new TimeoutStrategy()); + super.tearDown(); } protected boolean readLock(Transaction tx) @@ -88,23 +107,5 @@ { _lock.releaseLock(tx); return true; - } - - public void tearDown() - { - try - { - _tx1.rollback(); - _conn1.close(); - _conn1 = null; - - _tx2.rollback(); - _conn2.close(); - _conn2 = null; - } - catch (Throwable t) - { - } - _kit.setLockWaitStrategy(new TimeoutStrategy()); } } 1.2 +16 -11 db-ojb/src/test/org/apache/ojb/otm/MtoNTest.java Index: MtoNTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/MtoNTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MtoNTest.java 2 Jul 2003 00:04:18 -0000 1.1 +++ MtoNTest.java 11 Aug 2004 00:37:31 -0000 1.2 @@ -9,42 +9,47 @@ import java.util.List; import java.util.Vector; -import junit.framework.TestCase; +import org.apache.ojb.broker.Identity; +import org.apache.ojb.broker.Paper; +import org.apache.ojb.broker.PersistenceBrokerFactory; +import org.apache.ojb.broker.Qualifier; +import org.apache.ojb.broker.Topic; import org.apache.ojb.broker.metadata.ClassDescriptor; import org.apache.ojb.broker.metadata.CollectionDescriptor; import org.apache.ojb.broker.util.collections.ManageableArrayList; import org.apache.ojb.broker.util.collections.RemovalAwareCollection; -import org.apache.ojb.broker.*; -import org.apache.ojb.otm.lock.LockingException; +import org.apache.ojb.junit.OJBTestCase; import org.apache.ojb.otm.core.Transaction; +import org.apache.ojb.otm.lock.LockingException; /** * @author Matthew Baird * @version $Id$ */ -public class MtoNTest extends TestCase +public class MtoNTest extends OJBTestCase { - private static Class CLASS = MtoNTest.class; private TestKit _kit; private OTMConnection _conn; - private static final int COUNT = 1; - private static final long TIME = System.currentTimeMillis(); + //private static final int COUNT = 1; + //private static final long TIME = System.currentTimeMillis(); - public void setUp() throws LockingException + public void setUp() throws Exception { - _kit = TestKit.getTestInstance(); + super.setUp(); + _kit = TestKit.getTestInstance(); _conn = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey()); } - public void tearDown() throws LockingException + public void tearDown() throws Exception { _conn.close(); _conn = null; + super.tearDown(); }; public static void main(String[] args) { - String[] arr = {CLASS.getName()}; + String[] arr = {MtoNTest.class.getName()}; junit.textui.TestRunner.main(arr); } 1.5 +2 -1 db-ojb/src/test/org/apache/ojb/otm/MultipleConnectionsTest.java Index: MultipleConnectionsTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/MultipleConnectionsTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MultipleConnectionsTest.java 5 Apr 2004 12:16:25 -0000 1.4 +++ MultipleConnectionsTest.java 11 Aug 2004 00:37:31 -0000 1.5 @@ -24,13 +24,14 @@ import org.apache.ojb.odmg.oql.EnhancedOQLQuery; import org.apache.ojb.otm.core.Transaction; +import org.apache.ojb.junit.OJBTestCase; /** * Ensure a Transaction can attach multiple connections */ -public class MultipleConnectionsTest extends TestCase +public class MultipleConnectionsTest extends OJBTestCase { public MultipleConnectionsTest(String name) { 1.21 +16 -15 db-ojb/src/test/org/apache/ojb/otm/OtmExamples.java Index: OtmExamples.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/OtmExamples.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- OtmExamples.java 12 Apr 2004 16:32:42 -0000 1.20 +++ OtmExamples.java 11 Aug 2004 00:37:31 -0000 1.21 @@ -1,19 +1,19 @@ package org.apache.ojb.otm; -import junit.framework.TestCase; - import java.util.Collection; import java.util.Iterator; + import org.apache.ojb.broker.Article; +import org.apache.ojb.broker.Identity; import org.apache.ojb.broker.InterfaceArticle; +import org.apache.ojb.broker.PersistenceBrokerFactory; import org.apache.ojb.broker.ProductGroup; import org.apache.ojb.broker.ProductGroupWithCollectionProxy; -import org.apache.ojb.broker.Identity; -import org.apache.ojb.broker.PersistenceBrokerFactory; import org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl; import org.apache.ojb.broker.query.Criteria; import org.apache.ojb.broker.query.Query; import org.apache.ojb.broker.query.QueryFactory; +import org.apache.ojb.junit.OJBTestCase; import org.apache.ojb.odmg.oql.EnhancedOQLQuery; import org.apache.ojb.otm.core.Transaction; import org.apache.ojb.otm.lock.LockType; @@ -26,27 +26,35 @@ * Demo Application that shows basic concepts for Applications * using the OJB OTM layer directly. */ -public class OtmExamples extends TestCase +public class OtmExamples extends OJBTestCase { - private static Class CLASS = OtmExamples.class; private TestKit _kit; private OTMConnection _conn; + public static void main(String[] args) + { + String[] arr = {OtmExamples.class.getName()}; + junit.textui.TestRunner.main(arr); + } + + public OtmExamples(String name) { super(name); } - public void setUp() + public void setUp() throws Exception { + super.setUp(); _kit = TestKit.getTestInstance(); _conn = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey()); } - public void tearDown() + public void tearDown() throws Exception { _conn.close(); _conn = null; + super.tearDown(); } public void testOtmSession() throws Throwable @@ -845,11 +853,4 @@ tx2.rollback(); } } - - public static void main(String[] args) - { - String[] arr = {CLASS.getName()}; - junit.textui.TestRunner.main(arr); - } - } 1.5 +8 -6 db-ojb/src/test/org/apache/ojb/otm/PerformanceTest.java Index: PerformanceTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/PerformanceTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PerformanceTest.java 12 Apr 2004 18:20:37 -0000 1.4 +++ PerformanceTest.java 11 Aug 2004 00:37:31 -0000 1.5 @@ -2,9 +2,6 @@ import java.util.Iterator; -import junit.framework.TestCase; -import org.apache.ojb.otm.core.Transaction; -import org.apache.ojb.otm.lock.LockType; import org.apache.ojb.broker.Identity; import org.apache.ojb.broker.PerformanceArticle; import org.apache.ojb.broker.PersistenceBrokerFactory; @@ -13,13 +10,16 @@ import org.apache.ojb.broker.query.QueryByCriteria; import org.apache.ojb.broker.util.logging.Logger; import org.apache.ojb.broker.util.logging.LoggerFactory; +import org.apache.ojb.junit.OJBTestCase; +import org.apache.ojb.otm.core.Transaction; +import org.apache.ojb.otm.lock.LockType; /** * This TestCase contains the OJB performance benchmarks for the * OTM API. * @author Oleg Nitz, Matthew Baird, borrowing heavily from Thomas Mahler */ -public class PerformanceTest extends TestCase +public class PerformanceTest extends OJBTestCase { private Logger logger = LoggerFactory.getLogger("performance"); @@ -66,8 +66,9 @@ junit.textui.TestRunner.main(arr); } - public void setUp() + public void setUp() throws Exception { + super.setUp(); _kit = TestKit.getTestInstance(); _conn = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey()); arr = new PerformanceArticle[articleCount]; @@ -78,10 +79,11 @@ } } - public void tearDown() + public void tearDown() throws Exception { _conn.close(); _conn = null; + super.tearDown(); } /** 1.16 +25 -17 db-ojb/src/test/org/apache/ojb/otm/SwizzleTests.java Index: SwizzleTests.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/otm/SwizzleTests.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- SwizzleTests.java 22 Jun 2004 18:16:24 -0000 1.15 +++ SwizzleTests.java 11 Aug 2004 00:37:31 -0000 1.16 @@ -1,51 +1,59 @@ package org.apache.ojb.otm; -import junit.framework.TestCase; -import org.apache.ojb.broker.*; +import java.sql.Timestamp; +import java.util.Collection; +import java.util.Iterator; + +import org.apache.ojb.broker.Article; +import org.apache.ojb.broker.Contract; +import org.apache.ojb.broker.Effectiveness; +import org.apache.ojb.broker.Identity; +import org.apache.ojb.broker.PBFactoryException; +import org.apache.ojb.broker.PersistenceBrokerException; +import org.apache.ojb.broker.PersistenceBrokerFactory; +import org.apache.ojb.broker.ProductGroup; +import org.apache.ojb.broker.RelatedToContract; +import org.apache.ojb.broker.Version; import org.apache.ojb.broker.query.Criteria; -import org.apache.ojb.broker.query.QueryFactory; import org.apache.ojb.broker.query.Query; +import org.apache.ojb.broker.query.QueryFactory; +import org.apache.ojb.junit.OJBTestCase; +import org.apache.ojb.odmg.shared.TestClassA; +import org.apache.ojb.odmg.shared.TestClassB; import org.apache.ojb.otm.core.Transaction; import org.apache.ojb.otm.core.TransactionException; -import org.apache.ojb.otm.lock.LockingException; import org.apache.ojb.otm.lock.LockType; -import org.apache.ojb.odmg.shared.TestClassA; -import org.apache.ojb.odmg.shared.TestClassB; -import org.apache.ojb.odmg.shared.TestClassA; -import org.apache.ojb.odmg.shared.TestClassB; - -import java.sql.Timestamp; -import java.util.Collection; -import java.util.Iterator; +import org.apache.ojb.otm.lock.LockingException; /** * User: Matthew Baird * Date: Jun 21, 2003 * Time: 3:59:08 PM */ -public class SwizzleTests extends TestCase +public class SwizzleTests extends OJBTestCase { - private static Class CLASS = SwizzleTests.class; private TestKit _kit; private OTMConnection _conn; private static final int COUNT = 1; private static final long TIME = System.currentTimeMillis(); - public void setUp() throws LockingException + public void setUp() throws Exception { + super.setUp(); _kit = TestKit.getTestInstance(); _conn = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey()); } - public void tearDown() throws LockingException + public void tearDown() throws Exception { _conn.close(); _conn = null; + super.tearDown(); } public static void main(String[] args) { - String[] arr = {CLASS.getName()}; + String[] arr = {SwizzleTests.class.getName()}; junit.textui.TestRunner.main(arr); } 1.10 +18 -16 db-ojb/src/test/org/apache/ojb/performance/PerfMain.java Index: PerfMain.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/performance/PerfMain.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- PerfMain.java 14 Jun 2004 12:47:29 -0000 1.9 +++ PerfMain.java 11 Aug 2004 00:37:31 -0000 1.10 @@ -77,7 +77,6 @@ { protected static final String EOL = System.getProperty("line.separator"); - private static final String PREFIX_LOG = "[" + PerfMain.class.getName() + "] "; /** * iterations per thread */ @@ -197,6 +196,8 @@ test.registerPerfMain(this); Runtime rt = Runtime.getRuntime(); long freeMem = 0; + + test.setUp(); for (int i = 0; i < testLoops; i++) { System.out.println("perform test loop " + (i + 1)); @@ -206,6 +207,7 @@ System.out.println("allocated memory after test: " + freeMem + " kb"); rt.gc(); } + test.tearDown(); } } @@ -312,19 +314,19 @@ return blanks + target; } - private String buildObjectBeforeAfterList(List consistentList) - { - StringBuffer buf = new StringBuffer(); - buf.append("Test failed, inconsistent object count:"); - buf.append(EOL); - for (int i = 0; i < consistentList.size(); i++) - { - ConsistentEntry entry = (ConsistentEntry) consistentList.get(i); - buf.append("passed: " + entry.isPassed() + " - objects before test/ after test " + - entry.getObjectsBefore() + "/" + entry.getObjectsAfter() + EOL); - } - return buf.toString(); - } +// private String buildObjectBeforeAfterList(List consistentList) +// { +// StringBuffer buf = new StringBuffer(); +// buf.append("Test failed, inconsistent object count:"); +// buf.append(EOL); +// for (int i = 0; i < consistentList.size(); i++) +// { +// ConsistentEntry entry = (ConsistentEntry) consistentList.get(i); +// buf.append("passed: " + entry.isPassed() + " - objects before test/ after test " + +// entry.getObjectsBefore() + "/" + entry.getObjectsAfter() + EOL); +// } +// return buf.toString(); +// } /** * resultArr[0] startTime/test length @@ -571,7 +573,7 @@ { private int objectsBefore; private int objectsAfter; - private boolean passed; + // private boolean passed; public ConsistentEntry(int objectsBefore, int objectsAfter) { 1.10 +17 -8 db-ojb/src/test/org/apache/ojb/performance/PerfTest.java Index: PerfTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/performance/PerfTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- PerfTest.java 5 Apr 2004 12:16:22 -0000 1.9 +++ PerfTest.java 11 Aug 2004 00:37:31 -0000 1.10 @@ -33,7 +33,6 @@ * testTimes[4] deleting times */ private long[] testTimes; - private int threadCount; private ThreadGroup threadGroup; private PerfMain perfMain; private long perfTestId; @@ -56,12 +55,12 @@ public abstract String testName(); /** - * Returns a new instance of a {@link PerfHandle} implementation. + * Returns a new instance of a {@link org.apache.ojb.performance.PerfHandle} implementation. */ - public abstract PerfHandle newPerfHandle(PerfTest test); + public abstract org.apache.ojb.performance.PerfHandle newPerfHandle(PerfTest test); /** - * Returns the count of all found {@link PerfArticle} + * Returns the count of all found {@link org.apache.ojb.performance.PerfArticle} * in database. Do not use the cache to get the count! * This method is not involved in the performance test * methods, thus it's not mandatory to use the api-methods @@ -69,12 +68,22 @@ */ public abstract int articleCount(); + /** + * Do initial work here. Was called one time before the test starts. + */ + public abstract void setUp(); + + /** + * Do cleanup here. Was called one time after the test. + */ + public abstract void tearDown(); + private void checkApi() throws Exception { String name = testName() + "_Pre_Test_Object"; - PerfHandle handle = newPerfHandle(this); - PerfArticle article = handle.getPreparedPerfArticle(name); + org.apache.ojb.performance.PerfHandle handle = newPerfHandle(this); + org.apache.ojb.performance.PerfArticle article = handle.getPreparedPerfArticle(name); PerfArticle[] arr = new PerfArticle[]{article}; handle.init(); handle.insertNewArticles(arr); @@ -147,7 +156,7 @@ int objectCountAfter = 0; testTimes = new long[5]; - threadCount = PerfMain.getConcurrentThreads(); + // threadCount = PerfMain.getConcurrentThreads(); objectCount = articleCount(); 1.6 +4 -29 db-ojb/src/test/org/apache/ojb/soda/SodaExamples.java Index: SodaExamples.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/soda/SodaExamples.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SodaExamples.java 8 Apr 2003 20:19:28 -0000 1.5 +++ SodaExamples.java 11 Aug 2004 00:37:31 -0000 1.6 @@ -9,6 +9,8 @@ import org.apache.ojb.broker.query.QueryFactory; import org.apache.ojb.broker.util.logging.Logger; import org.apache.ojb.broker.util.logging.LoggerFactory; +import org.apache.ojb.junit.OJBTestCase; +import org.apache.ojb.junit.PBTestCase; import org.odbms.ObjectSet; import org.odbms.Query; @@ -17,12 +19,8 @@ * Creation date: (06.12.2000 21:47:56) * @author Thomas Mahler */ -public class SodaExamples extends TestCase +public class SodaExamples extends PBTestCase { - PersistenceBroker broker; - - private static Class CLASS = SodaExamples.class; - private Logger logger; /** @@ -36,33 +34,10 @@ logger = LoggerFactory.getLogger("soda"); } - /** - * Insert the method's description here. - * Creation date: (23.12.2000 18:30:38) - * @param args java.lang.String[] - */ public static void main(String[] args) { - String[] arr = { CLASS.getName()}; + String[] arr = {SodaExamples.class.getName()}; junit.textui.TestRunner.main(arr); - } - - /** - * Insert the method's description here. - * Creation date: (06.12.2000 21:58:53) - */ - public void setUp() throws PBFactoryException - { - broker = PersistenceBrokerFactory.defaultPersistenceBroker(); - } - - /** - * Insert the method's description here. - * Creation date: (06.12.2000 21:59:14) - */ - public void tearDown() - { - broker.close(); } protected org.apache.ojb.broker.query.Query ojbQuery() 1.2 +2 -2 db-ojb/src/test/org/apache/ojb/OJB-logging.properties Index: OJB-logging.properties =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/OJB-logging.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- OJB-logging.properties 1 Jun 2004 21:42:21 -0000 1.1 +++ OJB-logging.properties 11 Aug 2004 00:37:32 -0000 1.2 @@ -42,7 +42,7 @@ # # Global default log level used for all logging # entities if not specified -ROOT.LogLevel=ERROR +ROOT.LogLevel=WARN # # The Default Logger instance used within OJB DEFAULT.LogLevel=WARN 1.76 +14 -60 db-ojb/src/test/org/apache/ojb/OJB.properties Index: OJB.properties =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/OJB.properties,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- OJB.properties 27 Jun 2004 23:36:23 -0000 1.75 +++ OJB.properties 11 Aug 2004 00:37:32 -0000 1.76 @@ -101,42 +101,6 @@ # # #---------------------------------------------------------------------------------------- -# ConnectionFactory / Default ConnectionPool -#---------------------------------------------------------------------------------------- -# The ConnectionFactoryClass entry determines which kind of ConnectionFactory -# is to be used within org.apache.ojb as connection factory. -# A ConnectionFactory is responsible for creating -# JDBC Connections. Current version ships four implementations: -# -# 1. ConnectionFactoryNotPooledImpl -# No pooling, no playing around. -# Every connection request returns a new connection, -# every connection release close the connection. -# 2. ConnectionFactoryPooledImpl -# This implementation supports connection pooling. -# 3. ConnectionFactoryDBCPImpl -# Using the jakarta-DBCP api for connection management, support -# connection- and prepared statement-pooling, abandoned connection handling. -# 4. ConnectionFactoryManagedImpl -# Connection factory for use within managed environments - e.g. JBoss. -# Every obtained DataSource was wrapped within OJB (and ignore -# e.g. con.commit() calls within OJB). -# Use this implementation e.g if you use Datasources from an application server. -# -# Use the OJB performance tests to decide, which implementation is best for you. -# The proper way of obtaining a connection is configured in -# JDBCConnectionDescriptor entries in the repository.xml file. -# If want a more fine grained control of each connection pool used by OJB, -# take a look at the repository.dtd, there was a possibility to override -# this default connection factory entry in each JDBCConnectionDescriptor. -# -ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl -#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryNotPooledImpl -#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl -#ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl -# -# -#---------------------------------------------------------------------------------------- # ConnectionManager #---------------------------------------------------------------------------------------- # The ConnectionManagerClass entry defines the ConnectionManager implemementation to be used @@ -211,32 +175,17 @@ # RowReader on class-descriptor level. RowReaderDefaultClass=org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl # +# #---------------------------------------------------------------------------------------- -# Object cache +# IdentityFactory #---------------------------------------------------------------------------------------- -# The ObjectCacheClass entry tells OJB which concrete ObjectCache -# implementation is to be used as standard cache. -# Its also possible to override this entry adding object-cache elements -# on jdbc-connection-descriptor level and -# per class-descriptor in repository file. More info see documentation. -# -ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl -#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl -#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl -#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheJCSPerClassImpl -#ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerClassImpl -# -# -# This property is only relevant if the per class-descriptor object-cache -# declaration was used in conjunction with metadata runtime changes. -# If set 'flase' the class name of the object is used -# to find a per class ObjectCache implementation. -# If set 'true' the ObjectCacheDescriptor instance is used as key to -# find a per class ObjectCache, this enables to use different ObjectCache -# instances for the same class. -descriptorBasedCaches=false -# +# Specify implementation class for object identity creation, defined by +# org.apache.ojb.broker.IdenityFactory +IdentityFactoryClass=org.apache.ojb.broker.core.IdentityFactoryImpl # +#---------------------------------------------------------------------------------------- +# Caching +#---------------------------------------------------------------------------------------- # Use CacheFilters to do filter operations before caching methods were # called. Build your own filter class by implementing org.apache.ojb.cache.CacheFilter. # It is possible to use a arbitrary number of CacheFilters, but this slows @@ -249,6 +198,11 @@ # More info see Javadoc of the according classes. # Set a comma separated list of CacheFilter. #ObjectCacheFilter=org.apache.ojb.broker.cache.CacheFilterClassImpl,org.apache.ojb.broker.cache.CacheFilterPackageImpl +# +# The class used as first level cache. Each PersistenceBroker instance use its on +# instance of this class. +LocalCacheClass=org.apache.ojb.broker.cache.LocalCache +# # #---------------------------------------------------------------------------------------- # Locking 1.57 +2 -0 db-ojb/src/test/org/apache/ojb/repository.dtd Index: repository.dtd =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository.dtd,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- repository.dtd 5 Apr 2004 13:58:59 -0000 1.56 +++ repository.dtd 11 Aug 2004 00:37:32 -0000 1.57 @@ -190,6 +190,7 @@ --> @@ -271,6 +272,7 @@ --> + @@ -82,6 +83,7 @@ &junit_model; &junit_cloneable; &junit_pathClass; + &junit_perf_test; 1.25 +8 -4 db-ojb/src/test/org/apache/ojb/repository_database.xml Index: repository_database.xml =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_database.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- repository_database.xml 4 Aug 2004 00:12:41 -0000 1.24 +++ repository_database.xml 11 Aug 2004 00:37:32 -0000 1.25 @@ -46,13 +46,17 @@ ignoreAutoCommitExceptions="false" > - + + - - + + - + 1.120 +1 -55 db-ojb/src/test/org/apache/ojb/repository_junit.xml Index: repository_junit.xml =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit.xml,v retrieving revision 1.119 retrieving revision 1.120 diff -u -r1.119 -r1.120 --- repository_junit.xml 7 Aug 2004 20:00:26 -0000 1.119 +++ repository_junit.xml 11 Aug 2004 00:37:32 -0000 1.120 @@ -1313,60 +1313,6 @@ /> - - - - - - - - - - - - - + + @@ -173,7 +175,7 @@ 1.1 db-ojb/src/test/org/apache/ojb/repository_perf_test.xml Index: repository_perf_test.xml =================================================================== 1.4 +5 -0 db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/TestObjectCache.java Index: TestObjectCache.java =================================================================== RCS file: /home/cvs/db-ojb/src/xdoclet/test/xdoclet/modules/ojb/tests/TestObjectCache.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TestObjectCache.java 5 Apr 2004 12:16:17 -0000 1.3 +++ TestObjectCache.java 11 Aug 2004 00:37:33 -0000 1.4 @@ -39,4 +39,9 @@ public void remove(Identity oid) { } + + public boolean isShared() + { + return false; + } } 1.151 +15 -6 db-ojb/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/db-ojb/build.xml,v retrieving revision 1.150 retrieving revision 1.151 diff -u -r1.150 -r1.151 --- build.xml 8 Aug 2004 11:28:03 -0000 1.150 +++ build.xml 11 Aug 2004 00:37:33 -0000 1.151 @@ -1217,14 +1217,23 @@ + - - - - + + + + + + + + + --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org