org.apache.jackrabbit.test.api
Class ExportDocViewTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jackrabbit.test.JUnitTest
              extended by org.apache.jackrabbit.test.AbstractJCRTest
                  extended by org.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
isReadOnly, jcrBaseVersion, jcrCopiedFrom, jcrCreated, jcrFrozenNode, jcrFrozenUuid, jcrIsCheckedOut, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixShareable, mixSimpleVersionable, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testRoot, testRootNode, vf, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log, logger
 
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
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getProperty, getProperty, getSize, isSupported, needsMixin, 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 Exception
Overrides:
setUp in class AbstractJCRTest
Throws:
Exception

tearDown

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

testExportDocView_handler_session_skipBinary_noRecurse

public void testExportDocView_handler_session_skipBinary_noRecurse()
                                                            throws IOException,
                                                                   RepositoryException,
                                                                   SAXException,
                                                                   TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_handler_session_skipBinary_recurse

public void testExportDocView_handler_session_skipBinary_recurse()
                                                          throws IOException,
                                                                 RepositoryException,
                                                                 SAXException,
                                                                 TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_handler_session_saveBinary_noRecurse

public void testExportDocView_handler_session_saveBinary_noRecurse()
                                                            throws IOException,
                                                                   RepositoryException,
                                                                   SAXException,
                                                                   TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_handler_session_saveBinary_recurse

public void testExportDocView_handler_session_saveBinary_recurse()
                                                          throws IOException,
                                                                 RepositoryException,
                                                                 SAXException,
                                                                 TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_stream_session_skipBinary_recurse

public void testExportDocView_stream_session_skipBinary_recurse()
                                                         throws IOException,
                                                                RepositoryException,
                                                                SAXException,
                                                                TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_stream_session_skipBinary_noRecurse

public void testExportDocView_stream_session_skipBinary_noRecurse()
                                                           throws IOException,
                                                                  RepositoryException,
                                                                  SAXException,
                                                                  TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_stream_session_saveBinary_noRecurse

public void testExportDocView_stream_session_saveBinary_noRecurse()
                                                           throws IOException,
                                                                  RepositoryException,
                                                                  SAXException,
                                                                  TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

testExportDocView_stream_session_saveBinary_recurse

public void testExportDocView_stream_session_saveBinary_recurse()
                                                         throws IOException,
                                                                RepositoryException,
                                                                SAXException,
                                                                TransformerException
Throws:
IOException
RepositoryException
SAXException
TransformerException

doTestExportDocView

public void doTestExportDocView(boolean withHandler,
                                boolean skipBinary,
                                boolean noRecurse)
                         throws RepositoryException,
                                IOException,
                                SAXException,
                                TransformerException
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:
RepositoryException
IOException
SAXException
TransformerException


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.