org.apache.jackrabbit.test.api
Class ExportDocViewTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.jackrabbit.test.JUnitTest
              extended byorg.apache.jackrabbit.test.AbstractJCRTest
                  extended byorg.apache.jackrabbit.test.api.ExportDocViewTest
All Implemented Interfaces:
junit.framework.Test

public class ExportDocViewTest
extends AbstractJCRTest

ExportDocViewTest tests the two Session methods : Session.exportDocumentView(String, ContentHandler, boolean, boolean) and Session.exportDocumentView(String, java.io.OutputStream, boolean, boolean) against the required behaviours according the document view xml mapping defined in the JSR 170 specification in chapter 6.4.2, 6.4.3 and 6.4.4 .


Field Summary
 
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testRoot, testRootNode, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
ExportDocViewTest()
           
 
Method Summary
 void doTestExportDocView(boolean withHandler, boolean skipBinary, boolean noRecurse)
          Tests session.exportDocView with the different argument possibilities.
protected  void setUp()
           
protected  void tearDown()
           
 void testExportDocView_handler_session_saveBinary_noRecurse()
           
 void testExportDocView_handler_session_saveBinary_recurse()
           
 void testExportDocView_handler_session_skipBinary_noRecurse()
           
 void testExportDocView_handler_session_skipBinary_recurse()
           
 void testExportDocView_stream_session_saveBinary_noRecurse()
           
 void testExportDocView_stream_session_saveBinary_recurse()
           
 void testExportDocView_stream_session_skipBinary_noRecurse()
           
 void testExportDocView_stream_session_skipBinary_recurse()
           
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
createRandomString, getNonExistingWorkspaceName, getProperty, getSize, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExportDocViewTest

public ExportDocViewTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class AbstractJCRTest
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class AbstractJCRTest
Throws:
java.lang.Exception

testExportDocView_handler_session_skipBinary_noRecurse

public void testExportDocView_handler_session_skipBinary_noRecurse()
                                                            throws java.io.IOException,
                                                                   javax.jcr.RepositoryException,
                                                                   org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_handler_session_skipBinary_recurse

public void testExportDocView_handler_session_skipBinary_recurse()
                                                          throws java.io.IOException,
                                                                 javax.jcr.RepositoryException,
                                                                 org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_handler_session_saveBinary_noRecurse

public void testExportDocView_handler_session_saveBinary_noRecurse()
                                                            throws java.io.IOException,
                                                                   javax.jcr.RepositoryException,
                                                                   org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_handler_session_saveBinary_recurse

public void testExportDocView_handler_session_saveBinary_recurse()
                                                          throws java.io.IOException,
                                                                 javax.jcr.RepositoryException,
                                                                 org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_stream_session_skipBinary_recurse

public void testExportDocView_stream_session_skipBinary_recurse()
                                                         throws java.io.IOException,
                                                                javax.jcr.RepositoryException,
                                                                org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_stream_session_skipBinary_noRecurse

public void testExportDocView_stream_session_skipBinary_noRecurse()
                                                           throws java.io.IOException,
                                                                  javax.jcr.RepositoryException,
                                                                  org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_stream_session_saveBinary_noRecurse

public void testExportDocView_stream_session_saveBinary_noRecurse()
                                                           throws java.io.IOException,
                                                                  javax.jcr.RepositoryException,
                                                                  org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

testExportDocView_stream_session_saveBinary_recurse

public void testExportDocView_stream_session_saveBinary_recurse()
                                                         throws java.io.IOException,
                                                                javax.jcr.RepositoryException,
                                                                org.xml.sax.SAXException
Throws:
java.io.IOException
javax.jcr.RepositoryException
org.xml.sax.SAXException

doTestExportDocView

public void doTestExportDocView(boolean withHandler,
                                boolean skipBinary,
                                boolean noRecurse)
                         throws javax.jcr.RepositoryException,
                                java.io.IOException,
                                org.xml.sax.SAXException
Tests session.exportDocView with the different argument possibilities. The flag withHandler decides if the method requiring a ContentHandler as argument is called. The class org.apache.xml.serialize.XMLSerializer is taken as ContentHandler in this case. In both cases ( export with a ContentHandler and export with Stream) the test node is exported to the file defined in the setUp. This exported file is parsed using javax.xml.transform package and the receiving document is compared with the test node and its properties and child nodes in the repository.

Parameters:
withHandler - boolean, decides to call method requiring a ContentHandler as argument
skipBinary -
noRecurse -
Throws:
javax.jcr.RepositoryException
java.io.IOException
org.xml.sax.SAXException


Copyright © -2005 . All Rights Reserved.