org.exist.xmldb.test.concurrent
Class DBUtils

java.lang.Object
  extended byorg.exist.xmldb.test.concurrent.DBUtils

public class DBUtils
extends java.lang.Object

Static utility methods used by the tests.

Author:
wolf

Constructor Summary
DBUtils()
           
 
Method Summary
static Collection addCollection(Collection parent, java.lang.String name)
           
static void addXMLResource(Collection col, java.lang.String resourceId, java.io.File file)
           
static void addXMLResource(Collection col, java.lang.String resourceId, java.lang.String contents)
           
static java.io.File generateXMLFile(int depth, int elementCnt, int attrCnt, java.lang.String[] wordList, boolean namespaces)
           
static java.io.File generateXMLFile(int elementCnt, int attrCnt, java.lang.String[] wordList)
           
static java.io.File generateXMLFile(int elementCnt, int attrCnt, java.lang.String[] wordList, boolean namespaces)
           
static CollectionManagementService getCollectionManagementService(Collection col)
           
static XPathQueryService getQueryService(Collection collection)
           
static XQueryService getXQueryService(Collection collection)
           
static ResourceSet query(Collection collection, java.lang.String xpath)
           
static ResourceSet queryResource(Collection collection, java.lang.String resource, java.lang.String xpath)
           
static void removeCollection(Collection parent, java.lang.String name)
           
static Collection setupDB(java.lang.String uri)
           
static void shutdownDB(java.lang.String uri)
           
static java.lang.String[] wordList(Collection root)
           
static ResourceSet xquery(Collection collection, java.lang.String xquery)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBUtils

public DBUtils()
Method Detail

setupDB

public static Collection setupDB(java.lang.String uri)
                          throws java.lang.Exception
Throws:
java.lang.Exception

shutdownDB

public static void shutdownDB(java.lang.String uri)
                       throws XMLDBException
Throws:
XMLDBException

generateXMLFile

public static java.io.File generateXMLFile(int elementCnt,
                                           int attrCnt,
                                           java.lang.String[] wordList)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

generateXMLFile

public static java.io.File generateXMLFile(int elementCnt,
                                           int attrCnt,
                                           java.lang.String[] wordList,
                                           boolean namespaces)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

generateXMLFile

public static java.io.File generateXMLFile(int depth,
                                           int elementCnt,
                                           int attrCnt,
                                           java.lang.String[] wordList,
                                           boolean namespaces)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

addCollection

public static Collection addCollection(Collection parent,
                                       java.lang.String name)
                                throws XMLDBException
Throws:
XMLDBException

removeCollection

public static void removeCollection(Collection parent,
                                    java.lang.String name)
                             throws XMLDBException
Throws:
XMLDBException

getCollectionManagementService

public static CollectionManagementService getCollectionManagementService(Collection col)
                                                                  throws XMLDBException
Throws:
XMLDBException

addXMLResource

public static void addXMLResource(Collection col,
                                  java.lang.String resourceId,
                                  java.io.File file)
                           throws XMLDBException
Throws:
XMLDBException

addXMLResource

public static void addXMLResource(Collection col,
                                  java.lang.String resourceId,
                                  java.lang.String contents)
                           throws XMLDBException
Throws:
XMLDBException

query

public static ResourceSet query(Collection collection,
                                java.lang.String xpath)
                         throws XMLDBException
Throws:
XMLDBException

queryResource

public static ResourceSet queryResource(Collection collection,
                                        java.lang.String resource,
                                        java.lang.String xpath)
                                 throws XMLDBException
Throws:
XMLDBException

xquery

public static ResourceSet xquery(Collection collection,
                                 java.lang.String xquery)
                          throws XMLDBException
Throws:
XMLDBException

getQueryService

public static XPathQueryService getQueryService(Collection collection)
                                         throws XMLDBException
Throws:
XMLDBException

getXQueryService

public static XQueryService getXQueryService(Collection collection)
                                      throws XMLDBException
Throws:
XMLDBException

wordList

public static java.lang.String[] wordList(Collection root)
                                   throws XMLDBException
Throws:
XMLDBException


Copyright (C) Wolfgang Meier. All rights reserved.