svn commit: r592987 [2/2] - in /db/ojb/trunk/src/xdoclet: ./ java/src/xdoclet/modules/ojb/ java/src/xdoclet/modules/ojb/constraints/ sample/ sample/java/ sample/java/org/ sample/java/org/apache/ sample/java/org/apache/ojb/ sample/java/org/apache/ojb/sa...
[email protected] Thu, 08 Nov 2007 01:03:01 -0000
| Newsgroups | gmane.comp.jakarta.ojb.devel |
|---|---|
| Message-ID | <[email protected]> |
Added: db/ojb/trunk/src/xdoclet/sample/java/org/apache/ojb/sample/SampleTest.java
URL: http://svn.apache.org/viewvc/db/ojb/trunk/src/xdoclet/sample/java/org/apache/ojb/sample/SampleTest.java?rev=592987&view=auto
==============================================================================
--- db/ojb/trunk/src/xdoclet/sample/java/org/apache/ojb/sample/SampleTest.java (added)
+++ db/ojb/trunk/src/xdoclet/sample/java/org/apache/ojb/sample/SampleTest.java Wed Nov 7 17:02:59 2007
@@ -0,0 +1,84 @@
+package org.apache.ojb.sample;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.Object;
+
+import junit.framework.TestCase;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerFactory;
+import org.apache.ojb.broker.platforms.Platform;
+
+/**
+ * This class
+ *
+ * @version $Id$
+ */
+public class SampleTest extends TestCase
+{
+ public PersistenceBroker broker;
+
+ public static void main(String[] args)
+ {
+ junit.textui.TestRunner.main(new String[]{SampleTest.class.getName()});
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ assertNotNull(broker = PersistenceBrokerFactory.defaultPersistenceBroker());
+ // enable batch mode for all used PB instances
+ broker.serviceConnectionManager().setBatchMode(true);
+ }
+
+ public void tearDown() throws Exception
+ {
+ if(broker != null)
+ {
+ try
+ {
+ if(broker.isInTransaction()) broker.abortTransaction();
+ broker.close();
+ }
+ catch(Exception ignore)
+ {
+ }
+ }
+ super.tearDown();
+ }
+
+ public void test_A()
+ {
+
+ }
+
+ /**
+ * Returns a string based identifier for the current test compounded by
+ * test method name and current system time:
+ * <br/>
+ * _testMethodName_123349886_
+ *
+ * @return A string based test method identifier.
+ */
+ String ojbTestMethodIdentifier()
+ {
+ return "_" + getName() + "_" + System.currentTimeMillis() + "_";
+ }
+}