From: Wolfgang M. M. <wol...@us...> - 2004-08-03 16:46:27
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/src/org/exist/xmldb/test Modified Files: ResourceTest.java AllTests.java Log Message: All the addDocument methods in org.exist.collections.Collection have been split into two method calls: validate + store. Background: while locking the collection is necessary during validation, this is not really required while the document is being stored. The caller can thus release the lock after validate has completed. Index: AllTests.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/AllTests.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AllTests.java 9 Jul 2004 16:44:41 -0000 1.4 --- AllTests.java 3 Aug 2004 16:45:45 -0000 1.5 *************** *** 11,15 **** suite.addTest(new TestSuite(CreateCollectionsTest.class)); suite.addTest(new TestSuite(ResourceTest.class)); ! suite.addTest(new TestSuite(ResourceSetTest.class)); suite.addTest(new TestSuite(TestEXistXMLSerialize.class)); //$JUnit-END$ --- 11,15 ---- suite.addTest(new TestSuite(CreateCollectionsTest.class)); suite.addTest(new TestSuite(ResourceTest.class)); ! // suite.addTest(new TestSuite(ResourceSetTest.class)); suite.addTest(new TestSuite(TestEXistXMLSerialize.class)); //$JUnit-END$ Index: ResourceTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/ResourceTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ResourceTest.java 15 Jul 2004 19:43:23 -0000 1.9 --- ResourceTest.java 3 Aug 2004 16:45:44 -0000 1.10 *************** *** 24,28 **** import org.xmldb.api.base.Database; import org.xmldb.api.base.XMLDBException; - import org.xmldb.api.modules.CollectionManagementService; import org.xmldb.api.modules.XMLResource; --- 24,27 ---- *************** *** 76,88 **** assertNotNull(elem); assertEquals(elem.getNodeName(), "PLAY"); ! System.out.println("root element: " + elem.getNodeName()); NodeList children = elem.getChildNodes(); Node node; for (int i = 0; i < children.getLength(); i++) { node = children.item(i); assertNotNull(node); node = node.getFirstChild(); ! while((node = node.getNextSibling() ) != null) System.out.println("child: " + node.getNodeName()); } } catch (XMLDBException e) { --- 75,90 ---- assertNotNull(elem); assertEquals(elem.getNodeName(), "PLAY"); ! System.out.println("Root element: " + elem.getNodeName()); NodeList children = elem.getChildNodes(); Node node; for (int i = 0; i < children.getLength(); i++) { node = children.item(i); + System.out.println("Child: " + node.getNodeName()); assertNotNull(node); node = node.getFirstChild(); ! while(node != null) { System.out.println("child: " + node.getNodeName()); + node = node.getNextSibling(); + } } } catch (XMLDBException e) { *************** *** 216,219 **** --- 218,236 ---- } + protected void setUp() { + try { + // initialize driver + Class cl = Class.forName(DRIVER); + Database database = (Database) cl.newInstance(); + database.setProperty("create-database", "true"); + DatabaseManager.registerDatabase(database); + } catch (ClassNotFoundException e) { + } catch (InstantiationException e) { + } catch (IllegalAccessException e) { + } catch (XMLDBException e) { + e.printStackTrace(); + } + } + public static void main(String[] args) { junit.textui.TestRunner.run(ResourceTest.class); |