Search in sources :

Example 36 with XdmNodeWriteTrx

use of org.sirix.api.XdmNodeWriteTrx in project sirix by sirixdb.

the class TestHelper method createTestDocument.

/**
 * Creating a test document at {@link PATHS#PATH1}.
 *
 * @throws SirixException
 */
public static void createTestDocument() throws SirixException {
    try (final Database database = TestHelper.getDatabase(PATHS.PATH1.getFile())) {
        database.createResource(new ResourceConfiguration.Builder(RESOURCE, PATHS.PATH1.config).build());
        try (final ResourceManager manager = database.getResourceManager(new ResourceManagerConfiguration.Builder(RESOURCE).build());
            final XdmNodeWriteTrx wtx = manager.beginNodeWriteTrx()) {
            DocumentCreater.create(wtx);
            wtx.commit();
        }
    }
}
Also used : XdmNodeWriteTrx(org.sirix.api.XdmNodeWriteTrx) Database(org.sirix.api.Database) XdmResourceManager(org.sirix.access.XdmResourceManager) ResourceManager(org.sirix.api.ResourceManager)

Example 37 with XdmNodeWriteTrx

use of org.sirix.api.XdmNodeWriteTrx in project sirix by sirixdb.

the class HashTest method testPostorderDeep.

@Test
public void testPostorderDeep() throws SirixException {
    final XdmNodeWriteTrx wtx = createWtx(HashKind.POSTORDER);
    testDeepTree(wtx);
}
Also used : XdmNodeWriteTrx(org.sirix.api.XdmNodeWriteTrx) Test(org.junit.Test)

Example 38 with XdmNodeWriteTrx

use of org.sirix.api.XdmNodeWriteTrx in project sirix by sirixdb.

the class HashTest method testRollingInsertRemove.

@Test
public void testRollingInsertRemove() throws SirixException {
    final XdmNodeWriteTrx wtx = createWtx(HashKind.ROLLING);
    testHashTreeWithInsertAndRemove(wtx);
}
Also used : XdmNodeWriteTrx(org.sirix.api.XdmNodeWriteTrx) Test(org.junit.Test)

Example 39 with XdmNodeWriteTrx

use of org.sirix.api.XdmNodeWriteTrx in project sirix by sirixdb.

the class HashTest method testPostorderInsertRemove.

@Test
public void testPostorderInsertRemove() throws SirixException {
    final XdmNodeWriteTrx wtx = createWtx(HashKind.POSTORDER);
    testHashTreeWithInsertAndRemove(wtx);
}
Also used : XdmNodeWriteTrx(org.sirix.api.XdmNodeWriteTrx) Test(org.junit.Test)

Example 40 with XdmNodeWriteTrx

use of org.sirix.api.XdmNodeWriteTrx in project sirix by sirixdb.

the class HashTest method testPostorderSetter.

@Test
public void testPostorderSetter() throws SirixException {
    final XdmNodeWriteTrx wtx = createWtx(HashKind.POSTORDER);
    testSetter(wtx);
}
Also used : XdmNodeWriteTrx(org.sirix.api.XdmNodeWriteTrx) Test(org.junit.Test)

Aggregations

XdmNodeWriteTrx (org.sirix.api.XdmNodeWriteTrx)101 Test (org.junit.Test)61 XdmNodeReadTrx (org.sirix.api.XdmNodeReadTrx)48 ResourceManager (org.sirix.api.ResourceManager)33 Database (org.sirix.api.Database)22 QNm (org.brackit.xquery.atomic.QNm)15 SirixException (org.sirix.exception.SirixException)15 Path (java.nio.file.Path)9 ByteArrayOutputStream (java.io.ByteArrayOutputStream)8 DocumentException (org.brackit.xquery.xdm.DocumentException)7 DatabaseConfiguration (org.sirix.access.conf.DatabaseConfiguration)7 DescendantAxis (org.sirix.axis.DescendantAxis)7 XMLSerializerBuilder (org.sirix.service.xml.serialize.XMLSerializer.XMLSerializerBuilder)7 IOException (java.io.IOException)5 NonStructuralWrapperAxis (org.sirix.axis.NonStructuralWrapperAxis)5 SirixIOException (org.sirix.exception.SirixIOException)5 SirixDeweyID (org.sirix.node.SirixDeweyID)5 DBNode (org.sirix.xquery.node.DBNode)5 XMLEventReader (javax.xml.stream.XMLEventReader)4 QueryException (org.brackit.xquery.QueryException)4