diff options
Diffstat (limited to '')
143 files changed, 25290 insertions, 0 deletions
diff --git a/qa/Makefile.am b/qa/Makefile.am new file mode 100644 index 0000000..1752412 --- /dev/null +++ b/qa/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = mockup libcmis libcmis-c diff --git a/qa/libcmis-c/Makefile.am b/qa/libcmis-c/Makefile.am new file mode 100644 index 0000000..c0de5ad --- /dev/null +++ b/qa/libcmis-c/Makefile.am @@ -0,0 +1,48 @@ +check_PROGRAMS = \ + test-api \ + test-c-build + +test_api_SOURCES = \ + test-allowable-actions.cxx \ + test-api.cxx \ + test-document.cxx \ + test-dummies.cxx \ + test-dummies.hxx \ + test-folder.cxx \ + test-object-type.cxx \ + test-object.cxx \ + test-property-type.cxx \ + test-property.cxx \ + test-repository.cxx \ + test-session.cxx + +test_api_CXXFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis-c/ \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) + +test_api_LDADD = \ + $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ + $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ + $(XML2_LIBS) \ + $(CURL_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +test_c_build_SOURCES = \ + test-build.c + +test_c_build_CFLAGS = \ + -I$(top_srcdir)/inc \ + $(XML2_CFLAGS) + +test_c_build_LDADD = \ + $(top_builddir)/src/libcmis-c/libcmis-c-@LIBCMIS_API_VERSION@.la \ + $(top_builddir)/src/libcmis/libcmis-@LIBCMIS_API_VERSION@.la \ + $(XML2_LIBS) \ + $(CURL_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +TESTS = test-api diff --git a/qa/libcmis-c/test-allowable-actions.cxx b/qa/libcmis-c/test-allowable-actions.cxx new file mode 100644 index 0000000..19332d4 --- /dev/null +++ b/qa/libcmis-c/test-allowable-actions.cxx @@ -0,0 +1,82 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/allowable-actions.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class AllowableActionsTest : public CppUnit::TestFixture +{ + private: + libcmis_AllowableActionsPtr getTested( ); + + public: + void isDefinedTest( ); + void isAllowedTest( ); + + CPPUNIT_TEST_SUITE( AllowableActionsTest ); + CPPUNIT_TEST( isDefinedTest ); + CPPUNIT_TEST( isAllowedTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( AllowableActionsTest ); + +libcmis_AllowableActionsPtr AllowableActionsTest::getTested( ) +{ + libcmis_AllowableActionsPtr result = new libcmis_allowable_actions( ); + libcmis::AllowableActionsPtr handle( new dummies::AllowableActions( ) ); + result->handle = handle; + + return result; +} + +void AllowableActionsTest::isDefinedTest( ) +{ + libcmis_AllowableActionsPtr allowableActions = getTested( ); + CPPUNIT_ASSERT( !libcmis_allowable_actions_isDefined( allowableActions, libcmis_DeleteObject ) ); + CPPUNIT_ASSERT( libcmis_allowable_actions_isDefined( allowableActions, libcmis_GetFolderParent ) ); + + libcmis_allowable_actions_free( allowableActions ); +} + +void AllowableActionsTest::isAllowedTest( ) +{ + libcmis_AllowableActionsPtr allowableActions = getTested( ); + CPPUNIT_ASSERT( libcmis_allowable_actions_isAllowed( allowableActions, libcmis_GetProperties ) ); + CPPUNIT_ASSERT( !libcmis_allowable_actions_isAllowed( allowableActions, libcmis_GetFolderParent ) ); + + libcmis_allowable_actions_free( allowableActions ); +} diff --git a/qa/libcmis-c/test-api.cxx b/qa/libcmis-c/test-api.cxx new file mode 100644 index 0000000..45b2daf --- /dev/null +++ b/qa/libcmis-c/test-api.cxx @@ -0,0 +1,39 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/ui/text/TestRunner.h> + +int main( int, char** ) +{ + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest( registry.makeTest() ); + bool wasSuccess = runner.run( "", false ); + return !wasSuccess; +} diff --git a/qa/libcmis-c/test-build.c b/qa/libcmis-c/test-build.c new file mode 100644 index 0000000..52ac44d --- /dev/null +++ b/qa/libcmis-c/test-build.c @@ -0,0 +1,36 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <libcmis-c/libcmis-c.h> + +int main ( int argc, char ** argv ) +{ + ( void )argc; + ( void )argv; + return 0; +} diff --git a/qa/libcmis-c/test-document.cxx b/qa/libcmis-c/test-document.cxx new file mode 100644 index 0000000..525cbaa --- /dev/null +++ b/qa/libcmis-c/test-document.cxx @@ -0,0 +1,621 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/error.h> +#include <libcmis-c/folder.h> +#include <libcmis-c/document.h> +#include <libcmis-c/object.h> +#include <libcmis-c/object-type.h> +#include <libcmis-c/property.h> +#include <libcmis-c/property-type.h> +#include <libcmis-c/vectors.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +extern bool isOutOfMemory; + +namespace +{ + string lcl_readFile( FILE* file ) + { + // Get the size + fseek( file, 0, SEEK_END ); + long size = ftell( file ); + rewind( file ); + + char* buf = new char[size + 1]; + size_t readbytes = fread( buf, 1, size, file ); + buf[ readbytes ] = '\0'; + + string result( buf ); + delete[] buf; + + return result; + } +} + +class DocumentTest : public CppUnit::TestFixture +{ + private: + libcmis_DocumentPtr getTested( bool isFiled, bool triggersFaults ); + dummies::Document* getTestedImplementation( libcmis_DocumentPtr document ); + + public: + void objectCastTest( ); + void objectCastFailureTest( ); + void objectFunctionsTest( ); + void getParentsTest( ); + void getParentsUnfiledTest( ); + void getParentsErrorTest( ); + void getContentStreamTest( ); + void getContentStreamErrorTest( ); + void getContentStreamBadAllocTest( ); + void setContentStreamTest( ); + void setContentStreamErrorTest( ); + void getContentTypeTest( ); + void getContentFilenameTest( ); + void getContentLengthTest( ); + void checkOutTest( ); + void checkOutErrorTest( ); + void cancelCheckoutTest( ); + void cancelCheckoutErrorTest( ); + void checkInTest( ); + void checkInErrorTest( ); + void getAllVersionsTest( ); + void getAllVersionsErrorTest( ); + + CPPUNIT_TEST_SUITE( DocumentTest ); + CPPUNIT_TEST( objectCastTest ); + CPPUNIT_TEST( objectCastFailureTest ); + CPPUNIT_TEST( objectFunctionsTest ); + CPPUNIT_TEST( getParentsTest ); + CPPUNIT_TEST( getParentsUnfiledTest ); + CPPUNIT_TEST( getParentsErrorTest ); + CPPUNIT_TEST( getContentStreamTest ); + CPPUNIT_TEST( getContentStreamErrorTest ); + CPPUNIT_TEST( getContentStreamBadAllocTest ); + CPPUNIT_TEST( setContentStreamTest ); + CPPUNIT_TEST( setContentStreamErrorTest ); + CPPUNIT_TEST( getContentTypeTest ); + CPPUNIT_TEST( getContentFilenameTest ); + CPPUNIT_TEST( getContentLengthTest ); + CPPUNIT_TEST( checkOutTest ); + CPPUNIT_TEST( checkOutErrorTest ); + CPPUNIT_TEST( cancelCheckoutTest ); + CPPUNIT_TEST( cancelCheckoutErrorTest ); + CPPUNIT_TEST( checkInTest ); + CPPUNIT_TEST( checkInErrorTest ); + CPPUNIT_TEST( getAllVersionsTest ); + CPPUNIT_TEST( getAllVersionsErrorTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( DocumentTest ); + +libcmis_DocumentPtr DocumentTest::getTested( bool isFiled, bool triggersFaults ) +{ + // Create the document + libcmis_DocumentPtr result = new libcmis_document( ); + libcmis::DocumentPtr handle( new dummies::Document( isFiled, triggersFaults ) ); + result->handle = handle; + + return result; +} + +dummies::Document* DocumentTest::getTestedImplementation( libcmis_DocumentPtr document ) +{ + dummies::Document* impl = dynamic_cast< dummies::Document* >( document->handle.get( ) ); + return impl; +} + +void DocumentTest::objectCastTest( ) +{ + // Create the test object to cast + libcmis_ObjectPtr tested = new libcmis_object( ); + libcmis::DocumentPtr handle( new dummies::Document( true, false ) ); + tested->handle = handle; + + // Test libcmis_is_document + CPPUNIT_ASSERT( libcmis_is_document( tested ) ); + + // Actually cast to a document + libcmis_DocumentPtr actual = libcmis_document_cast( tested ); + + // Check the result + CPPUNIT_ASSERT( NULL != actual ); + + // Check that the libcmis_object-* functions are working with the cast result + char* actualId = libcmis_object_getId( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Document::Id" ), string( actualId ) ); + free( actualId ); + + // Free it all + libcmis_document_free( actual ); + libcmis_object_free( tested ); +} + +void DocumentTest::objectCastFailureTest( ) +{ + // Create the test object to cast + libcmis_ObjectPtr tested = new libcmis_object( ); + libcmis::FolderPtr handle( new dummies::Folder( false, false ) ); + tested->handle = handle; + + // Test libcmis_is_document + CPPUNIT_ASSERT( !libcmis_is_document( tested ) ); + + // Actually cast to a document + libcmis_DocumentPtr actual = libcmis_document_cast( tested ); + + // Check the result + CPPUNIT_ASSERT( NULL == actual ); + + libcmis_object_free( tested ); +} + +void DocumentTest::objectFunctionsTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + char* actual = libcmis_object_getId( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Document::Id" ), string( actual ) ); + free( actual ); + libcmis_document_free( tested ); +} + +void DocumentTest::getParentsTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get the parent folders (tested method) + libcmis_vector_folder_Ptr actual = libcmis_document_getParents( tested, error ); + + // Check + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_folder_size( actual ) ); + + // Free it all + libcmis_vector_folder_free( actual ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getParentsUnfiledTest( ) +{ + libcmis_DocumentPtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get the parent folders (tested method) + libcmis_vector_folder_Ptr actual = libcmis_document_getParents( tested, error ); + + // Check + CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_folder_size( actual ) ); + + // Free it all + libcmis_vector_folder_free( actual ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getParentsErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get the parent folders (tested method) + libcmis_vector_folder_Ptr actual = libcmis_document_getParents( tested, error ); + + // Check + CPPUNIT_ASSERT( NULL == actual ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + + // Free it all + libcmis_vector_folder_free( actual ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getContentStreamTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get the content into a temporary file (tested method) + FILE* tmp = tmpfile( ); + libcmis_document_getContentStream( tested, + ( libcmis_writeFn )fwrite, tmp, error ); + + // Check + string expected = getTestedImplementation( tested )->getContentString( ); + + string actual = lcl_readFile( tmp ); + fclose( tmp ); + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT_EQUAL( expected, actual ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getContentStreamErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get the content into a temporary file (tested method) + FILE* tmp = tmpfile( ); + libcmis_document_getContentStream( tested, + ( libcmis_writeFn )fwrite, tmp, error ); + + // Check + string actual = lcl_readFile( tmp ); + fclose( tmp ); + CPPUNIT_ASSERT_EQUAL( string( ), actual ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getContentStreamBadAllocTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get the content into a temporary file (tested method) + FILE* tmp = tmpfile( ); + + isOutOfMemory= true; + libcmis_document_getContentStream( tested, + ( libcmis_writeFn )fwrite, tmp, error ); + isOutOfMemory = false; + + // Check + string actual = lcl_readFile( tmp ); + fclose( tmp ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty() ); + CPPUNIT_ASSERT_EQUAL( string( ), actual ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::setContentStreamTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Prepare the content to set + FILE* tmp = tmpfile( ); + string expected( "New Content Stream" ); + fwrite( expected.c_str( ), 1, expected.size( ), tmp ); + rewind( tmp ); + + // get the content into a temporary file (tested method) + const char* contentType = "content/type"; + const char* filename = "name.txt"; + libcmis_document_setContentStream( tested, + ( libcmis_readFn )fread, tmp, contentType, filename, true, error ); + fclose( tmp ); + + // Check + string actual = getTestedImplementation( tested )->getContentString( ); + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT_EQUAL( expected, actual ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::setContentStreamErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + string expected = getTestedImplementation( tested )->getContentString( ); + + // Prepare the content to set + FILE* tmp = tmpfile( ); + string newContent( "New Content Stream" ); + fwrite( newContent.c_str( ), 1, newContent.size( ), tmp ); + rewind( tmp ); + + // get the content into a temporary file (tested method) + const char* contentType = "content/type"; + const char* filename = "name.txt"; + libcmis_document_setContentStream( tested, + ( libcmis_readFn )fread, tmp, contentType, filename, true, error ); + fclose( tmp ); + + // Check + string actual = getTestedImplementation( tested )->getContentString( ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + CPPUNIT_ASSERT_EQUAL( expected, actual ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getContentTypeTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + char* actual = libcmis_document_getContentType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Document::ContentType" ), string( actual ) ); + free( actual ); + libcmis_document_free( tested ); +} + +void DocumentTest::getContentFilenameTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + char* actual = libcmis_document_getContentFilename( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Document::ContentFilename" ), string( actual ) ); + free( actual ); + libcmis_document_free( tested ); +} + +void DocumentTest::getContentLengthTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + long actual = libcmis_document_getContentLength( tested ); + CPPUNIT_ASSERT( 0 != actual ); + libcmis_document_free( tested ); +} + +void DocumentTest::checkOutTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // checkout a private working copy (tested method) + libcmis_DocumentPtr actual = libcmis_document_checkOut( tested, error ); + + // Check + CPPUNIT_ASSERT( NULL != actual ); + + // Free it all + libcmis_document_free( actual ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::checkOutErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // checkout a private working copy (tested method) + libcmis_DocumentPtr actual = libcmis_document_checkOut( tested, error ); + + // Check + CPPUNIT_ASSERT( NULL == actual ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + + // Free it all + libcmis_document_free( actual ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::cancelCheckoutTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // checkout a private working copy (tested method) + libcmis_document_cancelCheckout( tested, error ); + + // Check + CPPUNIT_ASSERT( 0 != libcmis_object_getRefreshTimestamp( tested ) ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::cancelCheckoutErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // checkout a private working copy (tested method) + libcmis_document_cancelCheckout( tested, error ); + + // Check + CPPUNIT_ASSERT( 0 == libcmis_object_getRefreshTimestamp( tested ) ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + + // Free it all + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::checkInTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Prepare the content to set + FILE* tmp = tmpfile( ); + string expected( "New Content Stream" ); + fwrite( expected.c_str( ), 1, expected.size( ), tmp ); + rewind( tmp ); + + // Create the properties for the new version + libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + const char* id = "Property1"; + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); + delete[] values; + libcmis_vector_property_append( properties, property ); + + // get the content into a temporary file (tested method) + const char* contentType = "content/type"; + const char* comment = "Version comment"; + const char* filename = "filename.txt"; + libcmis_DocumentPtr newVersion = libcmis_document_checkIn( + tested, true, comment, properties, + ( libcmis_readFn )fread, tmp, contentType, filename, error ); + fclose( tmp ); + + // Check + CPPUNIT_ASSERT( NULL != newVersion ); + + string actual = getTestedImplementation( tested )->getContentString( ); + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT_EQUAL( expected, actual ); + + libcmis_PropertyPtr checkedProperty = libcmis_object_getProperty( tested, "Property1" ); + libcmis_vector_string_Ptr newValues = libcmis_property_getStrings( checkedProperty ); + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_string_size( newValues ) ); + + // Free it all + libcmis_vector_string_free( newValues ); + libcmis_property_free( checkedProperty ); + libcmis_document_free( newVersion ); + libcmis_property_free( property ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( properties ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::checkInErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + string expected = getTestedImplementation( tested )->getContentString( ); + + // Prepare the content to set + FILE* tmp = tmpfile( ); + string newContent( "New Content Stream" ); + fwrite( newContent.c_str( ), 1, newContent.size( ), tmp ); + rewind( tmp ); + + // Create the properties for the new version + libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + const char* id = "Property1"; + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); + delete[] values; + libcmis_vector_property_append( properties, property ); + + // get the content into a temporary file (tested method) + const char* contentType = "content/type"; + const char* comment = "Version comment"; + const char* filename = "filename.txt"; + libcmis_DocumentPtr newVersion = libcmis_document_checkIn( + tested, true, comment, properties, + ( libcmis_readFn )fread, tmp, contentType, filename, error ); + fclose( tmp ); + + // Check + CPPUNIT_ASSERT( NULL == newVersion ); + + string actual = getTestedImplementation( tested )->getContentString( ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + CPPUNIT_ASSERT_EQUAL( expected, actual ); + + libcmis_PropertyPtr checkedProperty = libcmis_object_getProperty( tested, "Property1" ); + libcmis_vector_string_Ptr newValues = libcmis_property_getStrings( checkedProperty ); + CPPUNIT_ASSERT_EQUAL( size_t( 1 ), libcmis_vector_string_size( newValues ) ); + + // Free it all + libcmis_vector_string_free( newValues ); + libcmis_property_free( checkedProperty ); + libcmis_document_free( newVersion ); + libcmis_property_free( property ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( properties ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getAllVersionsTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get all versions (tested method) + libcmis_vector_document_Ptr versions = libcmis_document_getAllVersions( tested, error ); + + // Check + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_document_size( versions ) ); + libcmis_DocumentPtr actualVersion = libcmis_vector_document_get( versions, 0 ); + char* actualId = libcmis_object_getId( actualVersion ); + CPPUNIT_ASSERT( actualId != NULL ); + free( actualId ); + + // Free it all + libcmis_document_free( actualVersion ); + libcmis_vector_document_free( versions ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} + +void DocumentTest::getAllVersionsErrorTest( ) +{ + libcmis_DocumentPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // get all versions (tested method) + libcmis_vector_document_Ptr versions = libcmis_document_getAllVersions( tested, error ); + + // Check + CPPUNIT_ASSERT( NULL == versions ); + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + + // Free it all + libcmis_vector_document_free( versions ); + libcmis_error_free( error ); + libcmis_document_free( tested ); +} diff --git a/qa/libcmis-c/test-dummies.cxx b/qa/libcmis-c/test-dummies.cxx new file mode 100644 index 0000000..5056bcf --- /dev/null +++ b/qa/libcmis-c/test-dummies.cxx @@ -0,0 +1,633 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include "test-dummies.hxx" + +using namespace std; +using libcmis::PropertyPtrMap; + +bool isOutOfMemory = false; + +/// Ignore all tests results depending on this when running in valgrind +void * operator new ( size_t requestedSize ) +{ + if ( isOutOfMemory ) + { + throw bad_alloc( ); + } + + return malloc( requestedSize ); +} + +void operator delete ( void* ptr ) throw ( ) +{ + free( ptr ); +} + +#if __cplusplus > 201103L +void operator delete ( void* ptr, std::size_t ) throw ( ) +{ + free( ptr ); +} +#endif + +namespace dummies +{ + Session::Session( ) + { + } + + Session::~Session( ) + { + } + + libcmis::RepositoryPtr Session::getRepository( ) + { + libcmis::RepositoryPtr repo( new Repository( ) ); + return repo; + } + + + bool Session::setRepository( std::string ) + { + return true; + } + + vector< libcmis::RepositoryPtr > Session::getRepositories( ) + { + vector< libcmis::RepositoryPtr > repos; + libcmis::RepositoryPtr repo1( new Repository( ) ); + libcmis::RepositoryPtr repo2( new Repository( ) ); + repos.push_back( repo1 ); + repos.push_back( repo2 ); + return repos; + } + + libcmis::FolderPtr Session::getRootFolder() + { + libcmis::FolderPtr root( new Folder( true, false ) ); + return root; + } + + libcmis::ObjectPtr Session::getObject( string id ) + { + return getFolder( id ); + } + + libcmis::ObjectPtr Session::getObjectByPath( string path ) + { + return getFolder( path ); + } + + libcmis::FolderPtr Session::getFolder( string ) + { + libcmis::FolderPtr result( new Folder( false, false ) ); + return result; + } + + libcmis::ObjectTypePtr Session::getType( string ) + { + libcmis::ObjectTypePtr type( new ObjectType( true, false ) ); + return type; + } + + vector< libcmis::ObjectTypePtr > Session::getBaseTypes( ) + { + vector< libcmis::ObjectTypePtr > types; + libcmis::ObjectTypePtr type( new ObjectType( true, false ) ); + types.push_back( type ); + return types; + } + + std::string Session::getRefreshToken( ) + { + return string( ); + } + + Repository::Repository( ) : + libcmis::Repository( ) + { + m_id = string( "Repository::Id" ); + m_name = string( "Repository::Name" ); + m_description = string( "Repository::Description" ); + m_vendorName = string( "Repository::VendorName" ); + m_productName = string( "Repository::ProductName" ); + m_productVersion = string( "Repository::ProductVersion" ); + m_rootId = string( "Repository::RootId" ); + m_cmisVersionSupported = string( "Repository::CmisVersionSupported" ); + m_thinClientUri.reset( new string( "Repository::ThinClientUri" ) ); + m_principalAnonymous.reset( new string( "Repository::PrincipalAnonymous" ) ); + m_principalAnyone.reset( new string( "Repository::PrincipalAnyone" ) ); + } + + Repository::~Repository( ) + { + } + + PropertyType::PropertyType( string id, string xmlType ) : + libcmis::PropertyType( ) + { + setId( id ); + setLocalName( string( "PropertyType::LocalName" ) ); + setLocalNamespace( string( "PropertyType::LocalNamespace" ) ); + setDisplayName( string( "PropertyType::DisplayName" ) ); + setQueryName( string( "PropertyType::QueryName" ) ); + setTypeFromXml( xmlType ); + + // Setting true for the tests to see a difference with + // the default false result of the tested functions + setMultiValued( true ); + setUpdatable( true ); + setInherited( true ); + setRequired( true ); + setQueryable( true ); + setOrderable( true ); + setOpenChoice( true ); + } + + PropertyType::~PropertyType( ) + { + } + + AllowableActions::AllowableActions( ) : + libcmis::AllowableActions( ) + { + m_states.insert( pair< libcmis::ObjectAction::Type, bool >( libcmis::ObjectAction::GetProperties, true ) ); + m_states.insert( pair< libcmis::ObjectAction::Type, bool >( libcmis::ObjectAction::GetFolderParent, false ) ); + } + + AllowableActions::~AllowableActions( ) + { + } + + ObjectType::ObjectType( ) : + libcmis::ObjectType( ), + m_typeId( ), + m_childrenIds( ), + m_triggersFaults( false ) + { + } + + ObjectType::ObjectType( bool rootType, bool triggersFaults ) : + libcmis::ObjectType( ), + m_typeId( ), + m_childrenIds( ), + m_triggersFaults( triggersFaults ) + { + if ( rootType ) + m_typeId = "RootType"; + else + { + m_typeId = "ObjectType"; + m_parentTypeId = "ParentType"; + m_childrenIds.push_back( "ChildType1" ); + m_childrenIds.push_back( "ChildType2" ); + } + + m_baseTypeId = "RootType"; + libcmis::PropertyTypePtr propType1( new PropertyType( "Property1", "string" ) ); + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( propType1->getId( ), propType1 ) ); + libcmis::PropertyTypePtr propType2( new PropertyType( "Property2", "string" ) ); + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( propType2->getId( ), propType2 ) ); + libcmis::PropertyTypePtr propType3( new PropertyType( "Property3", "string" ) ); + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( propType3->getId( ), propType3 ) ); + + initMembers( ); + } + + void ObjectType::initMembers( ) + { + + m_id = m_typeId + "::Id"; + m_localName = m_typeId + "::LocalName"; + m_localNamespace = m_typeId + "::LocalNamespace"; + m_displayName = m_typeId + "::DisplayName"; + m_queryName = m_typeId + "::QueryName"; + m_description = m_typeId + "::Description"; + + m_creatable = true; + m_fileable = true; + m_queryable = true; + m_fulltextIndexed = true; + m_includedInSupertypeQuery = true; + m_controllablePolicy = true; + m_controllableAcl = true; + m_versionable = true; + m_contentStreamAllowed = libcmis::ObjectType::Allowed; + } + + ObjectType::~ObjectType( ) + { + } + + libcmis::ObjectTypePtr ObjectType::getParentType( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + ObjectType* parent = NULL; + if ( !m_parentTypeId.empty( ) ) + { + parent = new ObjectType( ); + parent->m_typeId = m_parentTypeId; + parent->m_parentTypeId = m_baseTypeId; + parent->m_baseTypeId = m_baseTypeId; + parent->m_childrenIds.push_back( m_id ); + parent->m_triggersFaults = m_triggersFaults; + parent->m_propertiesTypes = m_propertiesTypes; + + parent->initMembers( ); + } + + libcmis::ObjectTypePtr result( parent ); + return result; + } + + libcmis::ObjectTypePtr ObjectType::getBaseType( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + ObjectType* base = this; + if ( m_typeId != m_baseTypeId ) + { + base = new ObjectType( ); + base->m_typeId = m_baseTypeId; + base->m_baseTypeId = m_baseTypeId; + base->m_childrenIds.push_back( m_id ); + base->m_triggersFaults = m_triggersFaults; + base->m_propertiesTypes = m_propertiesTypes; + + base->initMembers( ); + } + + libcmis::ObjectTypePtr result( base ); + return result; + } + + vector< libcmis::ObjectTypePtr > ObjectType::getChildren( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + vector< libcmis::ObjectTypePtr > children; + + for ( vector< string >::iterator it = m_childrenIds.begin( ); it != m_childrenIds.end( ); ++it ) + { + ObjectType* child = new ObjectType( ); + child->m_typeId = *it; + child->m_parentTypeId = m_typeId; + child->m_baseTypeId = m_baseTypeId; + child->m_triggersFaults = m_triggersFaults; + child->m_propertiesTypes = m_propertiesTypes; + + child->initMembers( ); + + libcmis::ObjectTypePtr result( child ); + children.push_back( result ); + } + + return children; + } + + string ObjectType::toString( ) + { + return m_typeId + "::toString"; + } + + Object::Object( bool triggersFaults, string type ): + libcmis::Object( NULL ), + m_type( type ), + m_triggersFaults( triggersFaults ) + { + libcmis::PropertyTypePtr propertyType( new PropertyType( "Property1", "string" ) ); + vector< string > values; + values.push_back( "Value1" ); + libcmis::PropertyPtr property( new libcmis::Property( propertyType, values ) ); + m_properties.insert( pair< string, libcmis::PropertyPtr >( propertyType->getId( ), property ) ); + } + + string Object::getId( ) + { + return m_type + "::Id"; + } + + string Object::getName( ) + { + return m_type + "::Name"; + } + + vector< string > Object::getPaths( ) + { + vector< string > paths; + paths.push_back( string( "/Path1/" ) ); + paths.push_back( string( "/Path2/" ) ); + + return paths; + } + + string Object::getBaseType( ) + { + return m_type + "::BaseType"; + } + + string Object::getType( ) + { + return m_type + "::Type"; + } + + boost::posix_time::ptime Object::getCreationDate( ) + { + boost::posix_time::ptime now( boost::posix_time::second_clock::local_time( ) ); + return now; + } + + boost::posix_time::ptime Object::getLastModificationDate( ) + { + boost::posix_time::ptime now( boost::posix_time::second_clock::local_time( ) ); + return now; + } + + libcmis::ObjectPtr Object::updateProperties( + const PropertyPtrMap& ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + libcmis::ObjectPtr result( new Object( false ) ); + return result; + } + + libcmis::ObjectTypePtr Object::getTypeDescription( ) + { + libcmis::ObjectTypePtr type( new ObjectType( false, m_triggersFaults ) ); + return type; + } + + libcmis::AllowableActionsPtr Object::getAllowableActions( ) + { + libcmis::AllowableActionsPtr allowableActions( new AllowableActions( ) ); + return allowableActions; + } + + void Object::refresh( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + } + + void Object::remove( bool ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + } + + void Object::move( libcmis::FolderPtr, libcmis::FolderPtr ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + } + + void Object::toXml( xmlTextWriterPtr ) + { + } + + Folder::Folder( bool isRoot, bool triggersFaults ) : + libcmis::Object( NULL ), + libcmis::Folder( NULL ), + dummies::Object( triggersFaults, "Folder" ), + m_isRoot( isRoot ) + { + } + + libcmis::FolderPtr Folder::getFolderParent( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + libcmis::FolderPtr parent; + + if ( !m_isRoot ) + parent.reset( new Folder( true, m_triggersFaults ) ); + + return parent; + } + + vector< libcmis::ObjectPtr > Folder::getChildren( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + vector< libcmis::ObjectPtr > children; + + libcmis::ObjectPtr child1( new Object( m_triggersFaults ) ); + children.push_back( child1 ); + libcmis::ObjectPtr child2( new Object( m_triggersFaults ) ); + children.push_back( child2 ); + + return children; + } + + string Folder::getPath( ) + { + return string( "/Path/" ); + } + + bool Folder::isRootFolder( ) + { + return m_isRoot; + } + + libcmis::FolderPtr Folder::createFolder( const PropertyPtrMap& ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + libcmis::FolderPtr created( new Folder( true, m_triggersFaults ) ); + return created; + } + + libcmis::DocumentPtr Folder::createDocument( const PropertyPtrMap& properties, + boost::shared_ptr< ostream > os, string contentType, string filename ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + dummies::Document* document = new dummies::Document( true, false ); + + PropertyPtrMap propertiesCopy( properties ); + document->getProperties( ).swap( propertiesCopy ); + document->setContentStream( os, contentType, filename ); + + libcmis::DocumentPtr created( document ); + return created; + } + + vector< string > Folder::removeTree( bool, libcmis::UnfileObjects::Type, + bool ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + + vector< string > failed; + failed.push_back( "failed 1" ); + return failed; + } + + Document::Document( bool isFiled, bool triggersFaults ) : + libcmis::Object( NULL ), + libcmis::Document( NULL ), + dummies::Object( triggersFaults, "Document" ), + m_isFiled( isFiled ), + m_contentString( "Document::ContentStream" ) + { + } + + vector< libcmis::FolderPtr > Document::getParents( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + vector< libcmis::FolderPtr > parents; + if ( m_isFiled ) + { + libcmis::FolderPtr parent1( new Folder( true, m_triggersFaults ) ); + parents.push_back( parent1 ); + libcmis::FolderPtr parent2( new Folder( false, m_triggersFaults ) ); + parents.push_back( parent2 ); + } + + return parents; + } + + boost::shared_ptr< istream > Document::getContentStream( string /*streamId*/ ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + bool oldOutOfMem = isOutOfMemory; + isOutOfMemory = false; + boost::shared_ptr< istream > stream( new stringstream( m_contentString ) ); + isOutOfMemory = oldOutOfMem; + return stream; + } + + void Document::setContentStream( boost::shared_ptr< ostream > os, string, string, bool ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + istream is( os->rdbuf( ) ); + stringstream out; + is.seekg( 0 ); + int bufSize = 2048; + char* buf = new char[ bufSize ]; + while ( !is.eof( ) ) + { + is.read( buf, bufSize ); + size_t read = is.gcount( ); + out.write( buf, read ); + } + delete[] buf; + + m_contentString = out.str( ); + + time( &m_refreshTimestamp ); + } + + string Document::getContentType( ) + { + return "Document::ContentType"; + } + + string Document::getContentFilename( ) + { + return "Document::ContentFilename"; + } + + long Document::getContentLength( ) + { + return long( 12345 ); + } + + libcmis::DocumentPtr Document::checkOut( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + + libcmis::DocumentPtr result( new Document( true, m_triggersFaults ) ); + return result; + } + + void Document::cancelCheckout( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + time( &m_refreshTimestamp ); + } + + libcmis::DocumentPtr Document::checkIn( bool, string, const PropertyPtrMap& properties, + boost::shared_ptr< ostream > os, string contentType, string filename ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + m_properties = properties; + setContentStream( os, contentType, filename ); + time( &m_refreshTimestamp ); + + return libcmis::DocumentPtr( new Document( true, false ) ); + } + + vector< libcmis::DocumentPtr > Document::getAllVersions( ) + { + if ( m_triggersFaults ) + throw libcmis::Exception( "Fault triggered" ); + + vector< libcmis::DocumentPtr > versions; + + libcmis::DocumentPtr version1( new Document( true, false ) ); + versions.push_back( version1 ); + libcmis::DocumentPtr version2( new Document( true, false ) ); + versions.push_back( version2 ); + + return versions; + } +} diff --git a/qa/libcmis-c/test-dummies.hxx b/qa/libcmis-c/test-dummies.hxx new file mode 100644 index 0000000..161c813 --- /dev/null +++ b/qa/libcmis-c/test-dummies.hxx @@ -0,0 +1,223 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ +#ifndef _LIBCMIS_TEST_DUMMIES_HXX_ +#define _LIBCMIS_TEST_DUMMIES_HXX_ + + +#include <libcmis/allowable-actions.hxx> +#include <libcmis/document.hxx> +#include <libcmis/folder.hxx> +#include <libcmis/object.hxx> +#include <libcmis/object-type.hxx> +#include <libcmis/property-type.hxx> +#include <libcmis/repository.hxx> +#include <libcmis/session.hxx> + +/** This namespace contains dummy classes to simulate the libcmis layer + in the libcmis-c unit tests. + */ +namespace dummies +{ + class Session : public libcmis::Session + { + public: + Session( ); + ~Session( ); + + virtual libcmis::RepositoryPtr getRepository( ); + virtual bool setRepository( std::string repositoryId ); + virtual std::vector< libcmis::RepositoryPtr > getRepositories( ); + virtual libcmis::FolderPtr getRootFolder(); + virtual libcmis::ObjectPtr getObject( std::string id ); + virtual libcmis::ObjectPtr getObjectByPath( std::string path ); + virtual libcmis::FolderPtr getFolder( std::string id ); + virtual libcmis::ObjectTypePtr getType( std::string id ); + virtual std::vector< libcmis::ObjectTypePtr > getBaseTypes( ); + virtual std::string getRefreshToken( ); + virtual void setNoSSLCertificateCheck( bool /*noCheck*/ ) { } + }; + + class Repository : public libcmis::Repository + { + public: + Repository( ); + ~Repository( ); + }; + + class PropertyType : public libcmis::PropertyType + { + public: + PropertyType( std::string id, std::string xmlType ); + ~PropertyType( ); + }; + + /** Dummy for testing the C API for allowable actions. The dummy has only the + following actions defined: + \li \c GetProperties, defined to \c true + \li \c GetFolderParent, defined to \c false + */ + class AllowableActions : public libcmis::AllowableActions + { + public: + AllowableActions( ); + ~AllowableActions( ); + }; + + class ObjectType : public libcmis::ObjectType + { + private: + std::string m_typeId; + std::vector< std::string > m_childrenIds; + bool m_triggersFaults; + + ObjectType( ); + void initMembers( ); + + public: + ObjectType( bool rootType, bool triggersFaults ); + ~ObjectType( ); + + virtual boost::shared_ptr< libcmis::ObjectType > getParentType( ); + virtual boost::shared_ptr< libcmis::ObjectType > getBaseType( ); + virtual std::vector< boost::shared_ptr< libcmis::ObjectType > > getChildren( ); + + virtual std::string toString( ); + }; + + class Object : public virtual libcmis::Object + { + public: + std::string m_type; + bool m_triggersFaults; + + public: + Object( bool triggersFaults, std::string m_type = "Object" ); + ~Object( ) { } + + virtual std::string getId( ); + virtual std::string getName( ); + + virtual std::vector< std::string > getPaths( ); + + virtual std::string getBaseType( ); + virtual std::string getType( ); + + virtual std::string getCreatedBy( ) { return m_type + "::CreatedBy"; } + virtual boost::posix_time::ptime getCreationDate( ); + virtual std::string getLastModifiedBy( ) { return m_type + "::LastModifiedBy"; } + virtual boost::posix_time::ptime getLastModificationDate( ); + + virtual std::string getChangeToken( ) { return m_type + "::ChangeToken"; } + virtual bool isImmutable( ) { return true; }; + + virtual libcmis::ObjectPtr updateProperties( + const std::map< std::string, libcmis::PropertyPtr >& properties ); + + virtual libcmis::ObjectTypePtr getTypeDescription( ); + virtual libcmis::AllowableActionsPtr getAllowableActions( ); + + virtual void refresh( ); + + virtual void remove( bool allVersions = true ); + + virtual void move( libcmis::FolderPtr source, libcmis::FolderPtr destination ); + + virtual std::string toString( ) { return m_type + "::toString"; } + + virtual void toXml( xmlTextWriterPtr writer ); + }; + + class Folder : public libcmis::Folder, public Object + { + private: + bool m_isRoot; + + public: + Folder( bool isRoot, bool triggersFaults ); + ~Folder( ) { } + + virtual libcmis::FolderPtr getFolderParent( ); + virtual std::vector< libcmis::ObjectPtr > getChildren( ); + virtual std::string getPath( ); + + virtual bool isRootFolder( ); + + virtual libcmis::FolderPtr createFolder( const std::map< std::string, libcmis::PropertyPtr >& properties ); + virtual libcmis::DocumentPtr createDocument( const std::map< std::string, libcmis::PropertyPtr >& properties, + boost::shared_ptr< std::ostream > os, std::string contentType, std::string filename ); + + virtual std::vector< std::string > removeTree( bool allVersion = true, + libcmis::UnfileObjects::Type unfile = libcmis::UnfileObjects::Delete, + bool continueOnError = false ); + + virtual std::vector< std::string > getPaths( ) { return dummies::Object::getPaths( ); } + virtual std::string toString( ) { return dummies::Object::toString( ); } + }; + + class Document : public libcmis::Document, public Object + { + private: + bool m_isFiled; + std::string m_contentString; + + public: + Document( bool isFiled, bool triggersFaults ); + ~Document( ) { } + + std::string getContentString( ) { return m_contentString; } + + virtual std::vector< libcmis::FolderPtr > getParents( ); + + virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ); + + virtual void setContentStream( boost::shared_ptr< std::ostream > os, std::string contentType, + std::string fileName, bool overwrite = true ); + + virtual std::string getContentType( ); + + virtual std::string getContentFilename( ); + + virtual long getContentLength( ); + + virtual libcmis::DocumentPtr checkOut( ); + + virtual void cancelCheckout( ); + + virtual libcmis::DocumentPtr checkIn( bool isMajor, std::string comment, + const std::map< std::string, libcmis::PropertyPtr >& properties, + boost::shared_ptr< std::ostream > stream, + std::string contentType, std::string filename ); + + virtual std::vector< libcmis::DocumentPtr > getAllVersions( ); + + virtual std::vector< std::string > getPaths( ) { return dummies::Object::getPaths( ); } + virtual std::string toString( ) { return dummies::Object::toString( ); } + }; +} + +#endif diff --git a/qa/libcmis-c/test-folder.cxx b/qa/libcmis-c/test-folder.cxx new file mode 100644 index 0000000..171c57d --- /dev/null +++ b/qa/libcmis-c/test-folder.cxx @@ -0,0 +1,433 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/document.h> +#include <libcmis-c/error.h> +#include <libcmis-c/folder.h> +#include <libcmis-c/object.h> +#include <libcmis-c/object-type.h> +#include <libcmis-c/property.h> +#include <libcmis-c/property-type.h> +#include <libcmis-c/vectors.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class FolderTest : public CppUnit::TestFixture +{ + private: + libcmis_FolderPtr getTested( bool isRoot, bool triggersFaults ); + dummies::Document* getDocumentImplementation( libcmis_DocumentPtr document ); + + public: + void objectCastTest( ); + void objectCastFailureTest( ); + void objectFunctionsTest( ); + void getParentTest( ); + void getParentRootTest( ); + void getParentErrorTest( ); + void getChildrenTest( ); + void getChildrenErrorTest( ); + void getPathTest( ); + void createFolderTest( ); + void createFolderErrorTest( ); + void createDocumentTest( ); + void createDocumentErrorTest( ); + void removeTreeTest( ); + void removeTreeErrorTest( ); + + CPPUNIT_TEST_SUITE( FolderTest ); + CPPUNIT_TEST( objectCastTest ); + CPPUNIT_TEST( objectCastFailureTest ); + CPPUNIT_TEST( objectFunctionsTest ); + CPPUNIT_TEST( getParentTest ); + CPPUNIT_TEST( getParentRootTest ); + CPPUNIT_TEST( getParentErrorTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( getChildrenErrorTest ); + CPPUNIT_TEST( getPathTest ); + CPPUNIT_TEST( createFolderTest ); + CPPUNIT_TEST( createFolderErrorTest ); + CPPUNIT_TEST( createDocumentTest ); + CPPUNIT_TEST( createDocumentErrorTest ); + CPPUNIT_TEST( removeTreeTest ); + CPPUNIT_TEST( removeTreeErrorTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( FolderTest ); + +libcmis_FolderPtr FolderTest::getTested( bool isRoot, bool triggersFaults ) +{ + libcmis_FolderPtr result = new libcmis_folder( ); + libcmis::FolderPtr handle( new dummies::Folder( isRoot, triggersFaults ) ); + result->handle = handle; + + return result; +} + +dummies::Document* FolderTest::getDocumentImplementation( libcmis_DocumentPtr document ) +{ + dummies::Document* impl = dynamic_cast< dummies::Document* >( document->handle.get( ) ); + return impl; +} + +void FolderTest::objectCastTest( ) +{ + // Create the test object to cast + libcmis_ObjectPtr tested = new libcmis_object( ); + libcmis::FolderPtr handle( new dummies::Folder( false, false ) ); + tested->handle = handle; + + // Test libcmis_is_folder + CPPUNIT_ASSERT( libcmis_is_folder( tested ) ); + + // Actually cast to a folder + libcmis_FolderPtr actual = libcmis_folder_cast( tested ); + + // Check the result + CPPUNIT_ASSERT( NULL != actual ); + + // Check that the libcmis_object-* functions are working with the cast result + char* actualId = libcmis_object_getId( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Folder::Id" ), string( actualId ) ); + free( actualId ); + + // Free it all + libcmis_folder_free( actual ); + libcmis_object_free( tested ); +} + +void FolderTest::objectCastFailureTest( ) +{ + // Create the test object to cast + libcmis_ObjectPtr tested = new libcmis_object( ); + libcmis::DocumentPtr handle( new dummies::Document( true, false ) ); + tested->handle = handle; + + // Test libcmis_is_folder + CPPUNIT_ASSERT( !libcmis_is_folder( tested ) ); + + // Actually cast to a folder + libcmis_FolderPtr actual = libcmis_folder_cast( tested ); + + // Check the result + CPPUNIT_ASSERT( NULL == actual ); + + libcmis_object_free( tested ); +} + +void FolderTest::objectFunctionsTest( ) +{ + libcmis_FolderPtr tested = getTested( false, false ); + char* actual = libcmis_object_getId( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Folder::Id" ), string( actual ) ); + free( actual ); + libcmis_folder_free( tested ); +} + +void FolderTest::getParentTest( ) +{ + libcmis_FolderPtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_FolderPtr parent = libcmis_folder_getParent( tested, error ); + CPPUNIT_ASSERT( NULL != parent ); + CPPUNIT_ASSERT( !libcmis_folder_isRootFolder( tested ) ); + libcmis_folder_free( parent ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::getParentRootTest( ) +{ + libcmis_FolderPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_FolderPtr parent = libcmis_folder_getParent( tested, error ); + CPPUNIT_ASSERT( NULL == parent ); + CPPUNIT_ASSERT( libcmis_folder_isRootFolder( tested ) ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::getParentErrorTest( ) +{ + libcmis_FolderPtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_FolderPtr parent = libcmis_folder_getParent( tested, error ); + CPPUNIT_ASSERT( NULL == parent ); + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::getChildrenTest( ) +{ + libcmis_FolderPtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + libcmis_vector_object_Ptr children = libcmis_folder_getChildren( tested, error ); + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_object_size( children ) ); + libcmis_vector_object_free( children ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::getChildrenErrorTest( ) +{ + libcmis_FolderPtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + libcmis_vector_object_Ptr children = libcmis_folder_getChildren( tested, error ); + CPPUNIT_ASSERT( NULL == children ); + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::getPathTest( ) +{ + libcmis_FolderPtr tested = getTested( false, false ); + char* actual = libcmis_folder_getPath( tested ); + CPPUNIT_ASSERT_EQUAL( string( "/Path/" ), string( actual ) ); + free( actual ); + libcmis_folder_free( tested ); +} + +void FolderTest::createFolderTest( ) +{ + libcmis_FolderPtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Create the properties for the new folder + libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + const char* id = "Property1"; + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); + delete[] values; + libcmis_vector_property_append( properties, property ); + + // Create the new folder (method to test) + libcmis_FolderPtr created = libcmis_folder_createFolder( tested, properties, error ); + + // Check + CPPUNIT_ASSERT( NULL != created ); + + // Free everything + libcmis_folder_free( created ); + libcmis_property_free( property ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( properties ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::createFolderErrorTest( ) +{ + libcmis_FolderPtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Create the properties for the new folder + libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + const char* id = "Property1"; + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); + delete[] values; + libcmis_vector_property_append( properties, property ); + + // Create the new folder (method to test) + libcmis_FolderPtr created = libcmis_folder_createFolder( tested, properties, error ); + + // Check + CPPUNIT_ASSERT( NULL == created ); + + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + + // Free everything + libcmis_folder_free( created ); + libcmis_property_free( property ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( properties ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::createDocumentTest( ) +{ + libcmis_FolderPtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Prepare the content to set + FILE* tmp = tmpfile( ); + string expectedStream( "New Content Stream" ); + fwrite( expectedStream.c_str( ), 1, expectedStream.size( ), tmp ); + rewind( tmp ); + + // Create the properties for the new version + libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + const char* id = "Property1"; + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); + delete[] values; + libcmis_vector_property_append( properties, property ); + + // get the content into a temporary file (tested method) + const char* contentType = "content/type"; + const char* filename = "name.txt"; + libcmis_DocumentPtr actual = libcmis_folder_createDocument( tested, properties, + ( libcmis_readFn )fread, tmp, contentType, filename, error ); + fclose( tmp ); + + // Check + string actualStream = getDocumentImplementation( actual )->getContentString( ); + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT_EQUAL( expectedStream, actualStream ); + + libcmis_PropertyPtr checkedProperty = libcmis_object_getProperty( actual, "Property1" ); + libcmis_vector_string_Ptr newValues = libcmis_property_getStrings( checkedProperty ); + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_string_size( newValues ) ); + + // Free it all + libcmis_vector_string_free( newValues ); + libcmis_property_free( checkedProperty ); + libcmis_document_free( actual ); + libcmis_property_free( property ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( properties ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::createDocumentErrorTest( ) +{ + libcmis_FolderPtr tested = getTested( true, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Prepare the content to set + FILE* tmp = tmpfile( ); + string newStream( "New Content Stream" ); + fwrite( newStream.c_str( ), 1, newStream.size( ), tmp ); + rewind( tmp ); + + // Create the properties for the new version + libcmis_vector_property_Ptr properties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + const char* id = "Property1"; + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, id ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr property = libcmis_property_create( propertyType, values, size ); + delete[] values; + libcmis_vector_property_append( properties, property ); + + // get the content into a temporary file (tested method) + const char* contentType = "content/type"; + const char* filename = "name.txt"; + libcmis_DocumentPtr actual = libcmis_folder_createDocument( tested, properties, + ( libcmis_readFn )fread, tmp, contentType, filename, error ); + fclose( tmp ); + + // Check + CPPUNIT_ASSERT( !string( libcmis_error_getMessage( error ) ).empty( ) ); + CPPUNIT_ASSERT( NULL == actual ); + + // Free it all + libcmis_property_free( property ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( properties ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::removeTreeTest( ) +{ + libcmis_FolderPtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + + // Remove the tree (method to test) + libcmis_vector_string_Ptr failed = libcmis_folder_removeTree( tested, true, libcmis_Delete, true, error ); + + // Check + CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); + CPPUNIT_ASSERT_EQUAL( size_t( 1 ), libcmis_vector_string_size( failed ) ); + CPPUNIT_ASSERT_EQUAL( string( "failed 1" ), string( libcmis_vector_string_get( failed, 0 ) ) ); + + // Free everything + libcmis_vector_string_free( failed ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} + +void FolderTest::removeTreeErrorTest( ) +{ + libcmis_FolderPtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Remove the tree (method to test) + libcmis_vector_string_Ptr failed = libcmis_folder_removeTree( + tested, true, libcmis_Delete, true, error ); + + // Check + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + + // Free everything + libcmis_vector_string_free( failed ); + libcmis_error_free( error ); + libcmis_folder_free( tested ); +} diff --git a/qa/libcmis-c/test-object-type.cxx b/qa/libcmis-c/test-object-type.cxx new file mode 100644 index 0000000..99a0768 --- /dev/null +++ b/qa/libcmis-c/test-object-type.cxx @@ -0,0 +1,377 @@ + +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/error.h> +#include <libcmis-c/object-type.h> +#include <libcmis-c/property-type.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class ObjectTypeTest : public CppUnit::TestFixture +{ + private: + libcmis_ObjectTypePtr getTested( bool rootType, bool triggersFaults ); + + public: + void getIdTest( ); + void getLocalNameTest( ); + void getLocalNamespaceTest( ); + void getQueryNameTest( ); + void getDisplayNameTest( ); + void getDescriptionTest( ); + void getParentTypeTest( ); + void getParentTypeRootTest( ); + void getParentTypeErrorTest( ); + void getBaseTypeTest( ); + void getBaseTypeErrorTest( ); + void getChildrenTest( ); + void getChildrenErrorTest( ); + void isCreatableTest( ); + void isFileableTest( ); + void isQueryableTest( ); + void isFulltextIndexedTest( ); + void isIncludedInSupertypeQueryTest( ); + void isControllablePolicyTest( ); + void isControllableACLTest( ); + void isVersionableTest( ); + void getContentStreamAllowedTest( ); + void getPropertiesTypesTest( ); + void getPropertyTypeTest( ); + void toStringTest( ); + + // TODO Add more tests + + CPPUNIT_TEST_SUITE( ObjectTypeTest ); + CPPUNIT_TEST( getIdTest ); + CPPUNIT_TEST( getLocalNameTest ); + CPPUNIT_TEST( getLocalNamespaceTest ); + CPPUNIT_TEST( getQueryNameTest ); + CPPUNIT_TEST( getDisplayNameTest ); + CPPUNIT_TEST( getDescriptionTest ); + CPPUNIT_TEST( getParentTypeTest ); + CPPUNIT_TEST( getParentTypeRootTest ); + CPPUNIT_TEST( getParentTypeErrorTest ); + CPPUNIT_TEST( getBaseTypeTest ); + CPPUNIT_TEST( getBaseTypeErrorTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( getChildrenErrorTest ); + CPPUNIT_TEST( isCreatableTest ); + CPPUNIT_TEST( isFileableTest ); + CPPUNIT_TEST( isQueryableTest ); + CPPUNIT_TEST( isFulltextIndexedTest ); + CPPUNIT_TEST( isIncludedInSupertypeQueryTest ); + CPPUNIT_TEST( isControllablePolicyTest ); + CPPUNIT_TEST( isControllableACLTest ); + CPPUNIT_TEST( isVersionableTest ); + CPPUNIT_TEST( getContentStreamAllowedTest ); + CPPUNIT_TEST( getPropertiesTypesTest ); + CPPUNIT_TEST( getPropertyTypeTest ); + CPPUNIT_TEST( toStringTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( ObjectTypeTest ); + +libcmis_ObjectTypePtr ObjectTypeTest::getTested( bool rootType, bool triggersFaults ) +{ + libcmis_ObjectTypePtr result = new libcmis_object_type( ); + libcmis::ObjectTypePtr handle( new dummies::ObjectType( rootType, triggersFaults ) ); + result->handle = handle; + + return result; +} + +void ObjectTypeTest::getIdTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* id = libcmis_object_type_getId( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::Id" ), + string( id ) ); + free( id ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getLocalNameTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* actual = libcmis_object_type_getLocalName( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::LocalName" ), + string( actual ) ); + free( actual ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getLocalNamespaceTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* actual = libcmis_object_type_getLocalNamespace( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::LocalNamespace" ), + string( actual ) ); + free( actual ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getQueryNameTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* actual = libcmis_object_type_getQueryName( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::QueryName" ), + string( actual ) ); + free( actual ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getDisplayNameTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* actual = libcmis_object_type_getDisplayName( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::DisplayName" ), + string( actual ) ); + free( actual ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getDescriptionTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* actual = libcmis_object_type_getDescription( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::Description" ), + string( actual ) ); + free( actual ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getParentTypeTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_ObjectTypePtr parent = libcmis_object_type_getParentType( tested, error ); + + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + char* id = libcmis_object_type_getId( parent ); + CPPUNIT_ASSERT_EQUAL( string( "ParentType::Id" ), string( id ) ); + free( id ); + + libcmis_error_free( error ); + libcmis_object_type_free( parent ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getParentTypeRootTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( true, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_ObjectTypePtr parent = libcmis_object_type_getParentType( tested, error ); + + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT( NULL == parent ); + + libcmis_error_free( error ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getParentTypeErrorTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_ObjectTypePtr parent = libcmis_object_type_getParentType( tested, error ); + + CPPUNIT_ASSERT( NULL != libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT( NULL == parent ); + + libcmis_error_free( error ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getBaseTypeTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_ObjectTypePtr base = libcmis_object_type_getBaseType( tested, error ); + + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + char* id = libcmis_object_type_getId( base ); + CPPUNIT_ASSERT_EQUAL( string( "RootType::Id" ), string( id ) ); + free( id ); + + libcmis_error_free( error ); + libcmis_object_type_free( base ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getBaseTypeErrorTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_ObjectTypePtr base = libcmis_object_type_getBaseType( tested, error ); + + CPPUNIT_ASSERT( NULL != libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT( NULL == base ); + + libcmis_error_free( error ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getChildrenTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_vector_object_type_Ptr children = libcmis_object_type_getChildren( tested, error ); + + CPPUNIT_ASSERT( NULL == libcmis_error_getMessage( error ) ); + size_t size = libcmis_vector_object_type_size( children ); + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), size ); + + libcmis_error_free( error ); + libcmis_vector_object_type_free( children ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getChildrenErrorTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, true ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_vector_object_type_Ptr children = libcmis_object_type_getChildren( tested, error ); + + CPPUNIT_ASSERT( NULL != libcmis_error_getMessage( error ) ); + CPPUNIT_ASSERT( NULL == children ); + + libcmis_error_free( error ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isCreatableTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isCreatable( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isFileableTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isFileable( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isQueryableTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isQueryable( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isFulltextIndexedTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isFulltextIndexed( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isIncludedInSupertypeQueryTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isIncludedInSupertypeQuery( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isControllablePolicyTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isControllablePolicy( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isControllableACLTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isControllableACL( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::isVersionableTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT( libcmis_object_type_isVersionable( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getContentStreamAllowedTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + CPPUNIT_ASSERT_EQUAL( + libcmis_Allowed, + libcmis_object_type_getContentStreamAllowed( tested ) ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getPropertiesTypesTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + libcmis_vector_property_type_Ptr propertiesTypes = libcmis_object_type_getPropertiesTypes( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 3 ), libcmis_vector_property_type_size( propertiesTypes ) ); + libcmis_vector_property_type_free( propertiesTypes ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::getPropertyTypeTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + string id( "Property2" ); + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( tested, id.c_str( ) ); + char* propertyId = libcmis_property_type_getId( propertyType ); + CPPUNIT_ASSERT_EQUAL( id, string( propertyId ) ); + free( propertyId ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( tested ); +} + +void ObjectTypeTest::toStringTest( ) +{ + libcmis_ObjectTypePtr tested = getTested( false, false ); + char* actual = libcmis_object_type_toString( tested ); + CPPUNIT_ASSERT_EQUAL( + string( "ObjectType::toString" ), + string( actual ) ); + free( actual ); + libcmis_object_type_free( tested ); +} diff --git a/qa/libcmis-c/test-object.cxx b/qa/libcmis-c/test-object.cxx new file mode 100644 index 0000000..1b7324b --- /dev/null +++ b/qa/libcmis-c/test-object.cxx @@ -0,0 +1,425 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/allowable-actions.h> +#include <libcmis-c/error.h> +#include <libcmis-c/folder.h> +#include <libcmis-c/object.h> +#include <libcmis-c/object-type.h> +#include <libcmis-c/property.h> +#include <libcmis-c/property-type.h> +#include <libcmis-c/vectors.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class ObjectTest : public CppUnit::TestFixture +{ + private: + libcmis_ObjectPtr getTested( bool triggersFaults ); + libcmis_FolderPtr getTestFolder( ); + + public: + void getIdTest( ); + void getNameTest( ); + void getPathsTest( ); + void getBaseTypeTest( ); + void getTypeTest( ); + void getCreatedByTest( ); + void getCreationDateTest( ); + void getLastModifiedByTest( ); + void getLastModificationDateTest( ); + void getChangeTokenTest( ); + void isImmutableTest( ); + void getPropertiesTest( ); + void getPropertyTest( ); + void getPropertyMissingTest( ); + void updatePropertiesTest( ); + void updatePropertiesErrorTest( ); + void getTypeDescriptionTest( ); + void getAllowableActionsTest( ); + void refreshTest( ); + void refreshErrorTest( ); + void removeTest( ); + void removeErrorTest( ); + void moveTest( ); + void moveErrorTest( ); + void toStringTest( ); + + CPPUNIT_TEST_SUITE( ObjectTest ); + CPPUNIT_TEST( getIdTest ); + CPPUNIT_TEST( getNameTest ); + CPPUNIT_TEST( getPathsTest ); + CPPUNIT_TEST( getBaseTypeTest ); + CPPUNIT_TEST( getTypeTest ); + CPPUNIT_TEST( getCreatedByTest ); + CPPUNIT_TEST( getCreationDateTest ); + CPPUNIT_TEST( getLastModifiedByTest ); + CPPUNIT_TEST( getLastModificationDateTest ); + CPPUNIT_TEST( getChangeTokenTest ); + CPPUNIT_TEST( isImmutableTest ); + CPPUNIT_TEST( getPropertiesTest ); + CPPUNIT_TEST( getPropertyTest ); + CPPUNIT_TEST( getPropertyMissingTest ); + CPPUNIT_TEST( updatePropertiesTest ); + CPPUNIT_TEST( updatePropertiesErrorTest ); + CPPUNIT_TEST( getTypeDescriptionTest ); + CPPUNIT_TEST( getAllowableActionsTest ); + CPPUNIT_TEST( refreshTest ); + CPPUNIT_TEST( refreshErrorTest ); + CPPUNIT_TEST( removeTest ); + CPPUNIT_TEST( removeErrorTest ); + CPPUNIT_TEST( moveTest ); + CPPUNIT_TEST( moveErrorTest ); + CPPUNIT_TEST( toStringTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( ObjectTest ); + +libcmis_ObjectPtr ObjectTest::getTested( bool triggersFaults ) +{ + libcmis_ObjectPtr result = new libcmis_object( ); + libcmis::ObjectPtr handle( new dummies::Object( triggersFaults ) ); + result->handle = handle; + + return result; +} + +libcmis_FolderPtr ObjectTest::getTestFolder( ) +{ + libcmis_FolderPtr result = new libcmis_folder( ); + libcmis::FolderPtr handle( new dummies::Folder( false, false ) ); + result->handle = handle; + + return result; +} + +void ObjectTest::getIdTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getId( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::Id" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getNameTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getName( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::Name" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getPathsTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + libcmis_vector_string_Ptr actual = libcmis_object_getPaths( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), libcmis_vector_string_size( actual ) ); + CPPUNIT_ASSERT_EQUAL( + string( "/Path1/" ), + string( libcmis_vector_string_get( actual, 0 ) ) ); + libcmis_vector_string_free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getBaseTypeTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getBaseType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::BaseType" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getTypeTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::Type" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getCreatedByTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getCreatedBy( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::CreatedBy" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getCreationDateTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + time_t actual = libcmis_object_getCreationDate( tested ); + CPPUNIT_ASSERT( 0 != actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getLastModifiedByTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getLastModifiedBy( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::LastModifiedBy" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getLastModificationDateTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + time_t actual = libcmis_object_getLastModificationDate( tested ); + CPPUNIT_ASSERT( 0 != actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getChangeTokenTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_getChangeToken( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::ChangeToken" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::isImmutableTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + CPPUNIT_ASSERT( libcmis_object_isImmutable( tested ) ); + libcmis_object_free( tested ); +} + +void ObjectTest::getPropertiesTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + libcmis_vector_property_Ptr actual = libcmis_object_getProperties( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 1 ), libcmis_vector_property_size( actual ) ); + libcmis_vector_property_free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getPropertyTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + const char* id = "Property1"; + libcmis_PropertyPtr actual = libcmis_object_getProperty( tested, id ); + CPPUNIT_ASSERT( NULL != actual ); + libcmis_property_free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getPropertyMissingTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + const char* id = "MissingProperty"; + libcmis_PropertyPtr actual = libcmis_object_getProperty( tested, id ); + CPPUNIT_ASSERT( NULL == actual ); + libcmis_property_free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::updatePropertiesTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Create the changed properties map + libcmis_vector_property_Ptr newProperties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, "cmis:Property2" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr newProperty = libcmis_property_create( propertyType, values, size ); + delete[ ] values; + libcmis_vector_property_append( newProperties, newProperty ); + + // Update the properties (method under test) + libcmis_ObjectPtr updated = libcmis_object_updateProperties( tested, newProperties, error ); + + // Checks + CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); + CPPUNIT_ASSERT( updated != NULL ); + + // Free it all + libcmis_object_free( updated ); + libcmis_property_free( newProperty ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( newProperties ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::updatePropertiesErrorTest( ) +{ + libcmis_ObjectPtr tested = getTested( true ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Create the changed properties map + libcmis_vector_property_Ptr newProperties = libcmis_vector_property_create( ); + libcmis_ObjectTypePtr objectType = libcmis_object_getTypeDescription( tested ); + libcmis_PropertyTypePtr propertyType = libcmis_object_type_getPropertyType( objectType, "cmis:Property2" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "Value 1"; + values[1] = "Value 2"; + libcmis_PropertyPtr newProperty = libcmis_property_create( propertyType, values, size ); + delete[ ] values; + libcmis_vector_property_append( newProperties, newProperty ); + + // Update the properties (method under test) + libcmis_ObjectPtr updated = libcmis_object_updateProperties( tested, newProperties, error ); + + // Checks + CPPUNIT_ASSERT( updated == NULL ); + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + + // Free it all + libcmis_object_free( updated ); + libcmis_property_free( newProperty ); + libcmis_property_type_free( propertyType ); + libcmis_object_type_free( objectType ); + libcmis_vector_property_free( newProperties ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::getTypeDescriptionTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + libcmis_ObjectTypePtr actual = libcmis_object_getTypeDescription( tested ); + char* actualId = libcmis_object_type_getId( actual ); + CPPUNIT_ASSERT( !string( actualId ).empty( ) ); + free( actualId ); + libcmis_object_type_free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::getAllowableActionsTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + libcmis_AllowableActionsPtr actual = libcmis_object_getAllowableActions( tested ); + CPPUNIT_ASSERT( libcmis_allowable_actions_isDefined( actual, libcmis_GetFolderParent ) ); + libcmis_allowable_actions_free( actual ); + libcmis_object_free( tested ); +} + +void ObjectTest::refreshTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_object_refresh( tested, error ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::refreshErrorTest( ) +{ + libcmis_ObjectPtr tested = getTested( true ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_object_refresh( tested, error ); + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::removeTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_object_remove( tested, true, error ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::removeErrorTest( ) +{ + libcmis_ObjectPtr tested = getTested( true ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + libcmis_object_remove( tested, true, error ); + const char* actualMessage = libcmis_error_getMessage( error ); + CPPUNIT_ASSERT( !string( actualMessage ).empty( ) ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::moveTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + CPPUNIT_ASSERT_MESSAGE( "Timestamp not set to 0 initially", 0 == libcmis_object_getRefreshTimestamp( tested ) ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + // Move the object from source to dest (tested method) + libcmis_FolderPtr source = getTestFolder( ); + libcmis_FolderPtr dest = getTestFolder( ); + libcmis_object_move( tested, source, dest, error ); + + // Check + CPPUNIT_ASSERT_MESSAGE( "Timestamp not updated", 0 != libcmis_object_getRefreshTimestamp( tested ) ); + + // Free it all + libcmis_folder_free( dest ); + libcmis_folder_free( source ); + libcmis_error_free( error ); + libcmis_object_free( tested ); +} + +void ObjectTest::moveErrorTest( ) +{ +} + +void ObjectTest::toStringTest( ) +{ + libcmis_ObjectPtr tested = getTested( false ); + char* actual = libcmis_object_toString( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Object::toString" ), string( actual ) ); + free( actual ); + libcmis_object_free( tested ); +} diff --git a/qa/libcmis-c/test-property-type.cxx b/qa/libcmis-c/test-property-type.cxx new file mode 100644 index 0000000..c8832f6 --- /dev/null +++ b/qa/libcmis-c/test-property-type.cxx @@ -0,0 +1,251 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/property-type.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class PropertyTypeTest : public CppUnit::TestFixture +{ + private: + libcmis_PropertyTypePtr getTested( string id, string xmlType ); + + public: + void getIdTest( ); + void getLocalNameTest( ); + void getLocalNamespaceTest( ); + void getDisplayNameTest( ); + void getQueryNameTest( ); + void getTypeTest( ); + void isMultiValuedTest( ); + void isUpdatableTest( ); + void isInheritedTest( ); + void isRequiredTest( ); + void isQueryableTest( ); + void isOrderableTest( ); + void isOpenChoiceTest( ); + + CPPUNIT_TEST_SUITE( PropertyTypeTest ); + CPPUNIT_TEST( getIdTest ); + CPPUNIT_TEST( getLocalNameTest ); + CPPUNIT_TEST( getLocalNamespaceTest ); + CPPUNIT_TEST( getDisplayNameTest ); + CPPUNIT_TEST( getQueryNameTest ); + CPPUNIT_TEST( getTypeTest ); + CPPUNIT_TEST( isMultiValuedTest ); + CPPUNIT_TEST( isUpdatableTest ); + CPPUNIT_TEST( isInheritedTest ); + CPPUNIT_TEST( isRequiredTest ); + CPPUNIT_TEST( isQueryableTest ); + CPPUNIT_TEST( isOrderableTest ); + CPPUNIT_TEST( isOpenChoiceTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( PropertyTypeTest ); + +libcmis_PropertyTypePtr PropertyTypeTest::getTested( string id, string xmlType ) +{ + libcmis_PropertyTypePtr result = new libcmis_property_type( ); + libcmis::PropertyTypePtr handle( new dummies::PropertyType( id, xmlType ) ); + result->handle = handle; + + return result; +} + +void PropertyTypeTest::getIdTest( ) +{ + string id( "Id" ); + libcmis_PropertyTypePtr tested = getTested( id, "string" ); + char* actual = libcmis_property_type_getId( tested ); + CPPUNIT_ASSERT_EQUAL( id, string( actual ) ); + + free( actual ); + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::getLocalNameTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + char* actual = libcmis_property_type_getLocalName( tested ); + CPPUNIT_ASSERT_EQUAL( string( "PropertyType::LocalName" ), string( actual ) ); + + free( actual ); + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::getLocalNamespaceTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + char* actual = libcmis_property_type_getLocalNamespace( tested ); + CPPUNIT_ASSERT_EQUAL( string( "PropertyType::LocalNamespace" ), string( actual ) ); + + free( actual ); + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::getDisplayNameTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + char* actual = libcmis_property_type_getDisplayName( tested ); + CPPUNIT_ASSERT_EQUAL( string( "PropertyType::DisplayName" ), string( actual ) ); + + free( actual ); + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::getQueryNameTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + char* actual = libcmis_property_type_getQueryName( tested ); + CPPUNIT_ASSERT_EQUAL( string( "PropertyType::QueryName" ), string( actual ) ); + + free( actual ); + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::getTypeTest( ) +{ + // String + { + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); + CPPUNIT_ASSERT_EQUAL( libcmis_String, actualType ); + char* actualXml = libcmis_property_type_getXmlType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "String" ), string( actualXml ) ); + + free( actualXml ); + libcmis_property_type_free( tested ); + } + + // DateTime + { + libcmis_PropertyTypePtr tested = getTested( "id", "datetime" ); + libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); + CPPUNIT_ASSERT_EQUAL( libcmis_DateTime, actualType ); + char* actualXml = libcmis_property_type_getXmlType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "DateTime" ), string( actualXml ) ); + + free( actualXml ); + libcmis_property_type_free( tested ); + } + + // Integer + { + libcmis_PropertyTypePtr tested = getTested( "id", "integer" ); + libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); + CPPUNIT_ASSERT_EQUAL( libcmis_Integer, actualType ); + char* actualXml = libcmis_property_type_getXmlType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Integer" ), string( actualXml ) ); + + free( actualXml ); + libcmis_property_type_free( tested ); + } + + // Html + { + libcmis_PropertyTypePtr tested = getTested( "id", "html" ); + libcmis_property_type_Type actualType = libcmis_property_type_getType( tested ); + CPPUNIT_ASSERT_EQUAL( libcmis_String, actualType ); + char* actualXml = libcmis_property_type_getXmlType( tested ); + CPPUNIT_ASSERT_EQUAL( string( "Html" ), string( actualXml ) ); + + free( actualXml ); + libcmis_property_type_free( tested ); + } +} + +void PropertyTypeTest::isMultiValuedTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isMultiValued( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::isUpdatableTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isUpdatable( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::isInheritedTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isInherited( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::isRequiredTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isRequired( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::isQueryableTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isQueryable( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::isOrderableTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isOrderable( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} + +void PropertyTypeTest::isOpenChoiceTest( ) +{ + libcmis_PropertyTypePtr tested = getTested( "id", "string" ); + bool actual = libcmis_property_type_isOpenChoice( tested ); + CPPUNIT_ASSERT_EQUAL( true , actual ); + + libcmis_property_type_free( tested ); +} diff --git a/qa/libcmis-c/test-property.cxx b/qa/libcmis-c/test-property.cxx new file mode 100644 index 0000000..99c9b2c --- /dev/null +++ b/qa/libcmis-c/test-property.cxx @@ -0,0 +1,242 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/property.h> +#include <libcmis-c/property-type.h> +#include <libcmis-c/vectors.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class PropertyTest : public CppUnit::TestFixture +{ + private: + libcmis_PropertyTypePtr getTestType( string xmlType ); + + public: + void getDateTimesTest( ); + void getBoolsTest( ); + void getStringsTest( ); + void getLongsTest( ); + void getDoublesTest( ); + void setValuesTest( ); + + CPPUNIT_TEST_SUITE( PropertyTest ); + CPPUNIT_TEST( getDateTimesTest ); + CPPUNIT_TEST( getBoolsTest ); + CPPUNIT_TEST( getStringsTest ); + CPPUNIT_TEST( getLongsTest ); + CPPUNIT_TEST( getDoublesTest ); + CPPUNIT_TEST( setValuesTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( PropertyTest ); + +libcmis_PropertyTypePtr PropertyTest::getTestType( string xmlType ) +{ + libcmis_PropertyTypePtr result = new libcmis_property_type( ); + libcmis::PropertyTypePtr handle( new dummies::PropertyType( "Id", xmlType ) ); + result->handle = handle; + + return result; +} + +void PropertyTest::getDateTimesTest( ) +{ + libcmis_PropertyTypePtr type = getTestType( "datetime" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "2012-01-19T09:06:57.388Z"; + values[1] = "2012-02-19T09:06:57.388Z"; + libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); + + libcmis_vector_time_Ptr times = libcmis_property_getDateTimes( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_time_size( times ) ); + libcmis_vector_time_free( times ); + + libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); + CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); + libcmis_vector_string_free( strings ); + delete[] values; + + libcmis_vector_bool_Ptr bools = libcmis_property_getBools( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_bool_size( bools ) ); + libcmis_vector_bool_free( bools ); + + libcmis_property_free( tested ); + libcmis_property_type_free( type ); +} + +void PropertyTest::getBoolsTest( ) +{ + libcmis_PropertyTypePtr type = getTestType( "boolean" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "true"; + values[1] = "false"; + libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); + + libcmis_vector_bool_Ptr bools = libcmis_property_getBools( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_bool_size( bools ) ); + CPPUNIT_ASSERT_EQUAL( true, libcmis_vector_bool_get( bools, 0 ) ); + CPPUNIT_ASSERT_EQUAL( false, libcmis_vector_bool_get( bools, 1 ) ); + libcmis_vector_bool_free( bools ); + + libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); + CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); + libcmis_vector_string_free( strings ); + delete[] values; + + libcmis_vector_long_Ptr longs = libcmis_property_getLongs( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_long_size( longs ) ); + libcmis_vector_long_free( longs ); + + libcmis_property_free( tested ); + libcmis_property_type_free( type ); +} + + +void PropertyTest::getStringsTest( ) +{ + libcmis_PropertyTypePtr type = getTestType( "string" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "string 1"; + values[1] = "string 2"; + libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); + + libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); + CPPUNIT_ASSERT_EQUAL( string( values[0] ), string( libcmis_vector_string_get( strings, 0 ) ) ); + CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); + libcmis_vector_string_free( strings ); + delete[] values; + + libcmis_vector_double_Ptr doubles = libcmis_property_getDoubles( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_double_size( doubles ) ); + libcmis_vector_double_free( doubles ); + + libcmis_property_free( tested ); + libcmis_property_type_free( type ); +} + + +void PropertyTest::getLongsTest( ) +{ + libcmis_PropertyTypePtr type = getTestType( "integer" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "123456"; + values[1] = "789"; + libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); + + libcmis_vector_long_Ptr longs = libcmis_property_getLongs( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_long_size( longs ) ); + CPPUNIT_ASSERT_EQUAL( long( 123456 ), libcmis_vector_long_get( longs, 0 ) ); + CPPUNIT_ASSERT_EQUAL( long( 789 ), libcmis_vector_long_get( longs, 1 ) ); + libcmis_vector_long_free( longs ); + + libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); + CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); + libcmis_vector_string_free( strings ); + delete[] values; + + libcmis_vector_time_Ptr times = libcmis_property_getDateTimes( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_time_size( times ) ); + libcmis_vector_time_free( times ); + + libcmis_property_free( tested ); + libcmis_property_type_free( type ); +} + + +void PropertyTest::getDoublesTest( ) +{ + libcmis_PropertyTypePtr type = getTestType( "decimal" ); + size_t size = 2; + const char** values = new const char*[size]; + values[0] = "123.456"; + values[1] = "7.89"; + libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); + + libcmis_vector_double_Ptr doubles = libcmis_property_getDoubles( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_double_size( doubles ) ); + CPPUNIT_ASSERT_EQUAL( 123.456, libcmis_vector_double_get( doubles, 0 ) ); + CPPUNIT_ASSERT_EQUAL( 7.89, libcmis_vector_double_get( doubles, 1 ) ); + libcmis_vector_double_free( doubles ); + + libcmis_vector_string_Ptr strings = libcmis_property_getStrings( tested ); + CPPUNIT_ASSERT_EQUAL( size, libcmis_vector_string_size( strings ) ); + CPPUNIT_ASSERT_EQUAL( string( values[1] ), string( libcmis_vector_string_get( strings, 1 ) ) ); + libcmis_vector_string_free( strings ); + delete[] values; + + libcmis_vector_long_Ptr longs = libcmis_property_getLongs( tested ); + CPPUNIT_ASSERT_EQUAL( size_t( 0 ), libcmis_vector_long_size( longs ) ); + libcmis_vector_long_free( longs ); + + libcmis_property_free( tested ); + libcmis_property_type_free( type ); +} + + +void PropertyTest::setValuesTest( ) +{ + libcmis_PropertyTypePtr type = getTestType( "string" ); + size_t size = 1; + const char** values = new const char*[size]; + values[0] = "string 1"; + libcmis_PropertyPtr tested = libcmis_property_create( type, values, size ); + delete[] values; + + size_t newSize = 2; + const char** newValues = new const char*[newSize]; + newValues[0] = "new string 1"; + newValues[1] = "new string 2"; + libcmis_property_setValues( tested, newValues, newSize ); + + libcmis_vector_string_Ptr newStrings = libcmis_property_getStrings( tested ); + CPPUNIT_ASSERT_EQUAL( newSize, libcmis_vector_string_size( newStrings ) ); + CPPUNIT_ASSERT_EQUAL( string( newValues[0] ), string( libcmis_vector_string_get( newStrings, 0 ) ) ); + CPPUNIT_ASSERT_EQUAL( string( newValues[1] ), string( libcmis_vector_string_get( newStrings, 1 ) ) ); + libcmis_vector_string_free( newStrings ); + delete[] newValues; + + libcmis_property_free( tested ); + libcmis_property_type_free( type ); +} diff --git a/qa/libcmis-c/test-repository.cxx b/qa/libcmis-c/test-repository.cxx new file mode 100644 index 0000000..63e7363 --- /dev/null +++ b/qa/libcmis-c/test-repository.cxx @@ -0,0 +1,205 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/repository.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class RepositoryTest : public CppUnit::TestFixture +{ + private: + libcmis_RepositoryPtr getTested( ); + + public: + void getIdTest( ); + void getNameTest( ); + void getDescriptionTest( ); + void getVendorNameTest( ); + void getProductNameTest( ); + void getProductVersionTest( ); + void getRootIdTest( ); + void getCmisVersionSupportedTest( ); + void getThinClientUriTest( ); + void getPrincipalAnonymousTest( ); + void getPrincipalAnyoneTest( ); + + CPPUNIT_TEST_SUITE( RepositoryTest ); + CPPUNIT_TEST( getIdTest ); + CPPUNIT_TEST( getNameTest ); + CPPUNIT_TEST( getDescriptionTest ); + CPPUNIT_TEST( getVendorNameTest ); + CPPUNIT_TEST( getProductNameTest ); + CPPUNIT_TEST( getProductVersionTest ); + CPPUNIT_TEST( getRootIdTest ); + CPPUNIT_TEST( getCmisVersionSupportedTest ); + CPPUNIT_TEST( getThinClientUriTest ); + CPPUNIT_TEST( getPrincipalAnonymousTest ); + CPPUNIT_TEST( getPrincipalAnyoneTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( RepositoryTest ); + +libcmis_RepositoryPtr RepositoryTest::getTested( ) +{ + libcmis_RepositoryPtr result = new libcmis_repository( ); + + libcmis::RepositoryPtr handle( new dummies::Repository( ) ); + result->handle = handle; + + return result; +} + +void RepositoryTest::getIdTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getId( tested ); + string expected( "Repository::Id" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getNameTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getName( tested ); + string expected( "Repository::Name" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getDescriptionTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getDescription( tested ); + string expected( "Repository::Description" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getVendorNameTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getVendorName( tested ); + string expected( "Repository::VendorName" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getProductNameTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getProductName( tested ); + string expected( "Repository::ProductName" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getProductVersionTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getProductVersion( tested ); + string expected( "Repository::ProductVersion" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getRootIdTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getRootId( tested ); + string expected( "Repository::RootId" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getCmisVersionSupportedTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getCmisVersionSupported( tested ); + string expected( "Repository::CmisVersionSupported" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getThinClientUriTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getThinClientUri( tested ); + string expected( "Repository::ThinClientUri" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getPrincipalAnonymousTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getPrincipalAnonymous( tested ); + string expected( "Repository::PrincipalAnonymous" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + +void RepositoryTest::getPrincipalAnyoneTest( ) +{ + libcmis_RepositoryPtr tested = getTested( ); + char* actual = libcmis_repository_getPrincipalAnyone( tested ); + string expected( "Repository::PrincipalAnyone" ); + CPPUNIT_ASSERT_EQUAL( expected, string( actual ) ); + + free( actual ); + libcmis_repository_free( tested ); +} + diff --git a/qa/libcmis-c/test-session.cxx b/qa/libcmis-c/test-session.cxx new file mode 100644 index 0000000..b236bc5 --- /dev/null +++ b/qa/libcmis-c/test-session.cxx @@ -0,0 +1,88 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <libcmis-c/libcmis-c.h> + +#include "internals.hxx" +#include "test-dummies.hxx" + +using namespace std; + +class SessionTest : public CppUnit::TestFixture +{ + private: + libcmis_SessionPtr getTested( ); + + public: + void getRepositoriesTest( ); + void getBaseTypesTest( ); + + CPPUNIT_TEST_SUITE( SessionTest ); + CPPUNIT_TEST( getRepositoriesTest ); + CPPUNIT_TEST( getBaseTypesTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( SessionTest ); + +libcmis_SessionPtr SessionTest::getTested( ) +{ + libcmis_SessionPtr result = new libcmis_session(); + libcmis::Session* handle = new dummies::Session( ); + result->handle = handle; + return result; +} + +void SessionTest::getRepositoriesTest( ) +{ + libcmis_SessionPtr session = getTested( ); + libcmis_vector_Repository_Ptr repos = libcmis_session_getRepositories( session ); + size_t actualSize = libcmis_vector_repository_size( repos ); + CPPUNIT_ASSERT_EQUAL( size_t( 2 ), actualSize ); + libcmis_vector_repository_free( repos ); + libcmis_session_free( session ); +} + +void SessionTest::getBaseTypesTest( ) +{ + libcmis_SessionPtr session = getTested( ); + libcmis_ErrorPtr error = libcmis_error_create( ); + + libcmis_vector_object_type_Ptr types = libcmis_session_getBaseTypes( session, error ); + + size_t size = libcmis_vector_object_type_size( types ); + CPPUNIT_ASSERT_EQUAL( size_t( 1 ), size ); + + libcmis_error_free( error ); + libcmis_vector_object_type_free( types ); + libcmis_session_free( session ); +} diff --git a/qa/libcmis/Makefile.am b/qa/libcmis/Makefile.am new file mode 100644 index 0000000..b300854 --- /dev/null +++ b/qa/libcmis/Makefile.am @@ -0,0 +1,190 @@ +if !OS_WIN32 +mockup_tests = \ + test-atom \ + test-factory \ + test-sharepoint \ + test-ws +endif + +# these tests need updating to work again +# mockup_tests += \ +# test-gdrive \ +# test-onedrive + +check_PROGRAMS = \ + test-json \ + test-utils \ + ${mockup_tests} + +check_LIBRARIES = \ + libtest.a + +libtest_a_SOURCES = \ + test-helpers.cxx \ + test-helpers.hxx \ + test-main.cxx + +if !OS_WIN32 +libtest_a_SOURCES += \ + test-mockup-helpers.cxx \ + test-mockup-helpers.hxx +endif + +libtest_a_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(CURL_CFLAGS) \ + $(BOOST_CPPFLAGS) + +test_utils_SOURCES = \ + test-commons.cxx \ + test-decoder.cxx \ + test-soap.cxx \ + test-xmlutils.cxx + +test_utils_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + $(XML2_CFLAGS) \ + $(CURL_CFLAGS) \ + $(BOOST_CPPFLAGS) + +test_utils_LDADD = \ + libtest.a \ + $(top_builddir)/src/libcmis/libcmis.la \ + $(XML2_LIBS) \ + $(CURL_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +test_atom_SOURCES = \ + test-atom.cxx + +test_atom_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_atom_LDADD = \ + libtest.a \ + $(top_builddir)/qa/mockup/libcmis-mockup.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +test_gdrive_SOURCES = \ + test-gdrive.cxx + +test_gdrive_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_gdrive_LDADD = \ + libtest.a \ + $(top_builddir)/qa/mockup/libcmis-mockup.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +test_onedrive_SOURCES = \ + test-onedrive.cxx + +test_onedrive_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_onedrive_LDADD = \ + libtest.a \ + $(top_builddir)/qa/mockup/libcmis-mockup.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +test_sharepoint_SOURCES = \ + test-sharepoint.cxx + +test_sharepoint_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_sharepoint_LDADD = \ + libtest.a \ + $(top_builddir)/qa/mockup/libcmis-mockup.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + + +test_ws_SOURCES = \ + test-ws.cxx + +test_ws_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_ws_LDADD = \ + libtest.a \ + $(top_builddir)/qa/mockup/libcmis-mockup.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +test_json_SOURCES = \ + test-jsonutils.cxx + +test_json_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_json_LDADD = \ + libtest.a \ + $(top_builddir)/src/libcmis/libcmis.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(CURL_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + + +test_factory_SOURCES = \ + test-factory.cxx + +test_factory_CPPFLAGS = \ + -I$(top_srcdir)/inc \ + -I$(top_srcdir)/src/libcmis \ + -I$(top_srcdir)/qa/mockup \ + $(XML2_CFLAGS) \ + $(BOOST_CPPFLAGS) \ + -DDATA_DIR=\"$(top_srcdir)/qa/libcmis/data\" + +test_factory_LDADD = \ + libtest.a \ + $(top_builddir)/qa/mockup/libcmis-mockup.la \ + $(XML2_LIBS) \ + $(CPPUNIT_LIBS) \ + $(BOOST_DATE_TIME_LIBS) + +TESTS = test-utils test-json ${mockup_tests} diff --git a/qa/libcmis/data/atom/allowable-actions.xml b/qa/libcmis/data/atom/allowable-actions.xml new file mode 100644 index 0000000..3e59c9d --- /dev/null +++ b/qa/libcmis/data/atom/allowable-actions.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<ns2:allowableActions xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/restatom/200908/"> + <ns2:canDeleteObject>true</ns2:canDeleteObject> + <ns2:canUpdateProperties>true</ns2:canUpdateProperties> + <ns2:canGetFolderTree>true</ns2:canGetFolderTree> + <ns2:canGetProperties>true</ns2:canGetProperties> + <ns2:canGetObjectRelationships>false</ns2:canGetObjectRelationships> + <ns2:canGetObjectParents>true</ns2:canGetObjectParents> + <ns2:canGetFolderParent>true</ns2:canGetFolderParent> + <ns2:canGetDescendants>true</ns2:canGetDescendants> + <ns2:canMoveObject>true</ns2:canMoveObject> + <ns2:canDeleteContentStream>false</ns2:canDeleteContentStream> + <ns2:canCheckOut>false</ns2:canCheckOut> + <ns2:canCancelCheckOut>false</ns2:canCancelCheckOut> + <ns2:canCheckIn>false</ns2:canCheckIn> + <ns2:canSetContentStream>false</ns2:canSetContentStream> + <ns2:canGetAllVersions>false</ns2:canGetAllVersions> + <ns2:canAddObjectToFolder>false</ns2:canAddObjectToFolder> + <ns2:canRemoveObjectFromFolder>false</ns2:canRemoveObjectFromFolder> + <ns2:canGetContentStream>false</ns2:canGetContentStream> + <ns2:canApplyPolicy>false</ns2:canApplyPolicy> + <ns2:canGetAppliedPolicies>false</ns2:canGetAppliedPolicies> + <ns2:canRemovePolicy>false</ns2:canRemovePolicy> + <ns2:canGetChildren>true</ns2:canGetChildren> + <ns2:canCreateDocument>true</ns2:canCreateDocument> + <ns2:canCreateFolder>true</ns2:canCreateFolder> + <ns2:canCreateRelationship>false</ns2:canCreateRelationship> + <ns2:canDeleteTree>true</ns2:canDeleteTree> + <ns2:canGetRenditions>false</ns2:canGetRenditions> + <ns2:canGetACL>false</ns2:canGetACL> + <ns2:canApplyACL>false</ns2:canApplyACL> +</ns2:allowableActions> diff --git a/qa/libcmis/data/atom/create-document.xml b/qa/libcmis/data/atom/create-document.xml new file mode 100644 index 0000000..73372bc --- /dev/null +++ b/qa/libcmis/data/atom/create-document.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-28T14:10:06Z</atom:published> + <atom:title>create document</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=create-document" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>create document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>create-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=create-document" type="application/atom+xml;type=entry" cmisra:id="create-document"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=create-document" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=create-document" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:document" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=create-document" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=create-document" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=create-document" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=create-document" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/create-folder-bad-type.xml b/qa/libcmis/data/atom/create-folder-bad-type.xml new file mode 100644 index 0000000..b43401c --- /dev/null +++ b/qa/libcmis/data/atom/create-folder-bad-type.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2012-11-29T16:14:47Z</atom:published> + <atom:title>create folder</atom:title> + <app:edited>2012-11-29T16:14:47Z</app:edited> + <atom:updated>2012-11-29T16:14:47Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/create folder</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>create folder</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>create-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=create-folder" type="application/atom+xml;type=entry" cmisra:id="create-folder"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=create-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=create-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=create-folder" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=create-folder" type="application/atom+xml;type=feed"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=create-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=create-folder" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/create-folder.xml b/qa/libcmis/data/atom/create-folder.xml new file mode 100644 index 0000000..e7d3f9f --- /dev/null +++ b/qa/libcmis/data/atom/create-folder.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2012-11-29T16:14:47Z</atom:published> + <atom:title>create folder</atom:title> + <app:edited>2012-11-29T16:14:47Z</app:edited> + <atom:updated>2012-11-29T16:14:47Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/create folder</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>create folder</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>create-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=create-folder" type="application/atom+xml;type=entry" cmisra:id="create-folder"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=create-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=create-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Afolder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=create-folder" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=create-folder" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/children?id=create-folder" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=create-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=create-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=create-folder" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/get-versions.xml b/qa/libcmis/data/atom/get-versions.xml new file mode 100644 index 0000000..1960975 --- /dev/null +++ b/qa/libcmis/data/atom/get-versions.xml @@ -0,0 +1,230 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:title>Test Document</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="via" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-28T14:10:06Z</atom:published> + <atom:title>Test Document</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=test-document-1" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>version-series</cmis:value> + </cmis:propertyId> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>1.0</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document-1</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document-1</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=test-document-1" type="application/atom+xml;type=entry" cmisra:id="test-document-1"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document-1" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=test-document-1" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document-1" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=test-document-1" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document-1" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document-1" type="application/cmisacl+xml"/> + </atom:entry> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-28T14:10:06Z</atom:published> + <atom:title>Test Document</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=test-document-0" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>version-series</cmis:value> + </cmis:propertyId> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>0.1</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-27T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206754</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document-0</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-27T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document-0</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=test-document-0" type="application/atom+xml;type=entry" cmisra:id="test-document-0"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document-0" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=test-document-0" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document-0" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=test-document-0" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document-0" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document-0" type="application/cmisacl+xml"/> + </atom:entry> +</atom:feed> diff --git a/qa/libcmis/data/atom/root-children.xml b/qa/libcmis/data/atom/root-children.xml new file mode 100644 index 0000000..cb31611 --- /dev/null +++ b/qa/libcmis/data/atom/root-children.xml @@ -0,0 +1,389 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:title>Root Folder</atom:title> + <app:edited>2013-01-30T09:26:10Z</app:edited> + <atom:updated>2013-01-30T09:26:10Z</atom:updated> + <cmisra:numItems>5</cmisra:numItems> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/children?id=root-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=root-folder" type="application/cmisallowableactions+xml"/> + <atom:link rel="down" href="http://mockup/mock/children?id=root-folder" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=root-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=root-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=root-folder" type="application/cmisacl+xml"/> + <app:collection href="http://mockup/mock/children?id=root-folder"> + <atom:title type="text">Folder collection</atom:title> + <app:accept>application/cmisatom+xml</app:accept> + </app:collection> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-30T09:26:13Z</atom:published> + <atom:title>Child 1</atom:title> + <app:edited>2013-01-30T09:26:13Z</app:edited> + <atom:updated>2013-01-30T09:26:13Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=child1" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>33446</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 1</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:13.932Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537973932</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child1</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:13.932Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=child1" type="application/atom+xml;type=entry" cmisra:id="child1"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=child1" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=child1" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=child1" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=child1" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=child1" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=child1" type="application/cmisacl+xml"/> + </atom:entry> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-30T09:26:13Z</atom:published> + <atom:title>Child 2</atom:title> + <app:edited>2013-01-30T09:26:13Z</app:edited> + <atom:updated>2013-01-30T09:26:13Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=child2" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>33537</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 2</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:13.978Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537973978</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child2</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:13.978Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=child2" type="application/atom+xml;type=entry" cmisra:id="child2"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=child2" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=child2" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=child2" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=child2" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=child2" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=child2" type="application/cmisacl+xml"/> + </atom:entry> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-30T09:26:14Z</atom:published> + <atom:title>Child 3</atom:title> + <app:edited>2013-01-30T09:26:14Z</app:edited> + <atom:updated>2013-01-30T09:26:14Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=child3" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>33353</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 3</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:14.031Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537974031</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child3</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:14.031Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=child3" type="application/atom+xml;type=entry" cmisra:id="child3"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=child3" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=child3" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=child3" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=child3" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=child3" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=child3" type="application/cmisacl+xml"/> + </atom:entry> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-30T09:26:12Z</atom:published> + <atom:title>Child 4</atom:title> + <app:edited>2013-01-30T09:26:12Z</app:edited> + <atom:updated>2013-01-30T09:26:12Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Child 4</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 4</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child4</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:12.384Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537972384</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:12.384Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=child4" type="application/atom+xml;type=entry" cmisra:id="child4"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=child4" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=child4" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=child4" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=child4" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/children?id=child4" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=child4" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=child4" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=child4" type="application/cmisacl+xml"/> + </atom:entry> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-30T09:26:13Z</atom:published> + <atom:title>Child 5</atom:title> + <app:edited>2013-01-30T09:26:13Z</app:edited> + <atom:updated>2013-01-30T09:26:13Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Child 5</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 5</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child5</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:13.338Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537973338</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:13.338Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=child5" type="application/atom+xml;type=entry" cmisra:id="child5"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=child5" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=child5" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=child5" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=child5" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/children?id=child5" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=child5" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=child5" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=child5" type="application/cmisacl+xml"/> + </atom:entry> +</atom:feed> diff --git a/qa/libcmis/data/atom/root-folder.xml b/qa/libcmis/data/atom/root-folder.xml new file mode 100644 index 0000000..5baa288 --- /dev/null +++ b/qa/libcmis/data/atom/root-folder.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2012-11-29T16:14:47Z</atom:published> + <atom:title>Root Folder</atom:title> + <app:edited>2012-11-29T16:14:47Z</app:edited> + <atom:updated>2012-11-29T16:14:47Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Root Folder</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"/> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>true</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>true</cmis:canGetFolderParent> + <cmis:canGetDescendants>true</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>false</cmis:canDeleteContentStream> + <cmis:canCheckOut>false</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>false</cmis:canSetContentStream> + <cmis:canGetAllVersions>false</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>false</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>false</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>false</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>true</cmis:canGetChildren> + <cmis:canCreateDocument>true</cmis:canCreateDocument> + <cmis:canCreateFolder>true</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>true</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=root-folder" type="application/atom+xml;type=entry" cmisra:id="root-folder"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=root-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=root-folder" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Afolder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=root-folder" type="application/cmisallowableactions+xml"/> + <atom:link rel="down" href="http://mockup/mock/children?id=root-folder" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=root-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=root-folder" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=root-folder" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/test-document-parents.xml b/qa/libcmis/data/atom/test-document-parents.xml new file mode 100644 index 0000000..3e24f0e --- /dev/null +++ b/qa/libcmis/data/atom/test-document-parents.xml @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some Obscure Id</atom:id> + <atom:title>Test Document</atom:title> + <app:edited>2013-01-31T08:04:37Z</app:edited> + <atom:updated>2013-01-31T08:04:37Z</atom:updated> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/parents?id=test-document" type="application/atom+xml;type=entry"/> + <atom:entry> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some Obscure Id</atom:id> + <atom:published>2013-01-31T08:04:35Z</atom:published> + <atom:title>Parent 1</atom:title> + <app:edited>2013-01-31T08:04:35Z</app:edited> + <atom:updated>2013-01-31T08:04:35Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Parent 1</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Parent 1</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>parent1</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-31T08:04:35.866Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359619475867</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-31T08:04:35.867Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <cmisra:relativePathSegment>Test Document</cmisra:relativePathSegment> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=parent1" type="application/atom+xml;type=entry" cmisra:id="parent1"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=parent1" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=parent1" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=parent1" type="application/cmisallowableactions+xml"/> + <atom:link rel="down" href="http://mockup/mock/children?id=parent1" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=parent1" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=parent1" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=parent1" type="application/cmisacl+xml"/> + </atom:entry> + <atom:entry> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some Obscure Id</atom:id> + <atom:published>2013-01-31T08:04:35Z</atom:published> + <atom:title>Parent 2</atom:title> + <app:edited>2013-01-31T08:04:35Z</app:edited> + <atom:updated>2013-01-31T08:04:35Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Parent 2</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Parent 2</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>parent2</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-31T08:04:35.866Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359619475867</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-31T08:04:35.867Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmisra:object> + <cmisra:relativePathSegment>Test Document</cmisra:relativePathSegment> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/entry?id=parent2" type="application/atom+xml;type=entry" cmisra:id="parent2"/> + <atom:link rel="enclosure" href="http://mockup/mock/entry?id=parent2" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/entry?id=parent2" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=parent2" type="application/cmisallowableactions+xml"/> + <atom:link rel="down" href="http://mockup/mock/children?id=parent2" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=parent2" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=parent2" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=parent2" type="application/cmisacl+xml"/> + </atom:entry> +</atom:feed> diff --git a/qa/libcmis/data/atom/test-document-relationships.xml b/qa/libcmis/data/atom/test-document-relationships.xml new file mode 100644 index 0000000..bacfda8 --- /dev/null +++ b/qa/libcmis/data/atom/test-document-relationships.xml @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-28T14:10:06Z</atom:published> + <atom:title>Test Document</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=test-document" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>true</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>true</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + <cmis:relationship> + <cmis:properties> + <cmis:propertyId displayName="Target Id" localName="targetId" propertyDefinitionId="cmis:targetId" queryName="cmis:targetId"> + <cmis:value>workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;2.2</cmis:value> + </cmis:propertyId> + <cmis:propertyId displayName="Object Type Id" localName="objectTypeId" propertyDefinitionId="cmis:objectTypeId" queryName="cmis:objectTypeId"> + <cmis:value>R:cm:original</cmis:value> + </cmis:propertyId> + <cmis:propertyString displayName="Last Modified By" localName="lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy" queryName="cmis:lastModifiedBy"> + <cmis:value>admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId displayName="Source Id" localName="sourceId" propertyDefinitionId="cmis:sourceId" queryName="cmis:sourceId"> + <cmis:value>workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;pwc</cmis:value> + </cmis:propertyId> + <cmis:propertyString displayName="Name" localName="name" propertyDefinitionId="cmis:name" queryName="cmis:name"> + <cmis:value>75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original</cmis:value> + </cmis:propertyString> + <cmis:propertyString displayName="Created by" localName="createdBy" propertyDefinitionId="cmis:createdBy" queryName="cmis:createdBy"> + <cmis:value>admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId displayName="Object Id" localName="objectId" propertyDefinitionId="cmis:objectId" queryName="cmis:objectId"> + <cmis:value>assoc:75</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime displayName="Creation Date" localName="creationDate" propertyDefinitionId="cmis:creationDate" queryName="cmis:creationDate"> + <cmis:value>2010-05-01T00:00:00+02:00</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString displayName="Change token" localName="changeToken" propertyDefinitionId="cmis:changeToken" queryName="cmis:changeToken"/> + <cmis:propertyId displayName="Base Type Id" localName="baseTypeId" propertyDefinitionId="cmis:baseTypeId" queryName="cmis:baseTypeId"> + <cmis:value>cmis:relationship</cmis:value> + </cmis:propertyId> + <cmis:propertyId displayName="Alfresco Node Ref" localName="nodeRef" propertyDefinitionId="alfcmis:nodeRef" queryName="alfcmis:nodeRef"> + <cmis:value>75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original</cmis:value> + </cmis:propertyId> + <cmis:propertyString displayName="Description" localName="description" propertyDefinitionId="cmis:description" queryName="cmis:description"/> + <cmis:propertyDateTime displayName="Last Modified Date" localName="lastModificationDate" propertyDefinitionId="cmis:lastModificationDate" queryName="cmis:lastModificationDate"> + <cmis:value>2010-05-01T00:00:00+02:00</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmis:relationship> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry" cmisra:id="test-document"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=test-document" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document" type="application/cmisacl+xml"/> + <atom:link rel="version-history" href="http://mockup/mock/versions?id=test-document" type="application/atom+xml;type=feed"/> + <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition1" type="image/png" cmisra:renditionKind="cmis:thumbnail" title="picture" length="40385"/> + <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition2" type="application/pdf" cmisra:renditionKind="pdf" title="Doc as PDF"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/test-document-updated.xml b/qa/libcmis/data/atom/test-document-updated.xml new file mode 100644 index 0000000..31482f6 --- /dev/null +++ b/qa/libcmis/data/atom/test-document-updated.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-28T14:10:06Z</atom:published> + <atom:title>New name</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=test-document" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>New name</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>false</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>false</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>New name</name> + </exampleExtension:exampleExtension> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry" cmisra:id="test-document"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=ComplexType" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=test-document" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/test-document.xml b/qa/libcmis/data/atom/test-document.xml new file mode 100644 index 0000000..242ded2 --- /dev/null +++ b/qa/libcmis/data/atom/test-document.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-01-28T14:10:06Z</atom:published> + <atom:title>Test Document</atom:title> + <app:edited>2013-01-28T14:10:06Z</app:edited> + <atom:updated>2013-01-28T14:10:06Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=test-document" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>true</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>true</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + <cmis:rendition> + <cmis:streamId>http://mockup/mock/renditions?id=test-document-rendition1</cmis:streamId> + <cmis:mimetype>image/png</cmis:mimetype> + <cmis:length>40385</cmis:length> + <cmis:kind>cmis:thumbnail</cmis:kind> + <cmis:title>picture</cmis:title> + <cmis:height>100</cmis:height> + <cmis:width>100</cmis:width> + </cmis:rendition> + <cmis:rendition> + <cmis:streamId>http://mockup/mock/renditions?id=test-document-rendition2</cmis:streamId> + <cmis:mimetype>application/pdf</cmis:mimetype> + <cmis:kind>pdf</cmis:kind> + <cmis:title>Doc as PDF</cmis:title> + </cmis:rendition> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry" cmisra:id="test-document"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=test-document" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document" type="text/plain"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document" type="application/cmisacl+xml"/> + <atom:link rel="version-history" href="http://mockup/mock/versions?id=test-document" type="application/atom+xml;type=feed"/> + <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition1" type="image/png" cmisra:renditionKind="cmis:thumbnail" title="picture" length="40385"/> + <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition2" type="application/pdf" cmisra:renditionKind="pdf" title="Doc as PDF"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/type-docLevel1.xml b/qa/libcmis/data/atom/type-docLevel1.xml new file mode 100644 index 0000000..20d70c4 --- /dev/null +++ b/qa/libcmis/data/atom/type-docLevel1.xml @@ -0,0 +1,404 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>Document Level 1</atom:title> + <app:edited>2013-01-25T09:47:39Z</app:edited> + <atom:updated>2013-01-25T09:47:39Z</atom:updated> + <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xsi:type="cmis:cmisTypeDocumentDefinitionType"> + <cmis:id>DocumentLevel1</cmis:id> + <cmis:localName>DocumentLevel1</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 1</cmis:displayName> + <cmis:queryName>DocumentLevel1</cmis:queryName> + <cmis:description>Description of Document Level 1 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>cmis:document</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmisra:type> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry" cmisra:id="DocumentLevel1"/> + <atom:link rel="enclosure" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry"/> + <atom:link rel="up" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/types?typeId=DocumentLevel1" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=DocumentLevel1" type="application/cmistree+xml"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/type-docLevel2.xml b/qa/libcmis/data/atom/type-docLevel2.xml new file mode 100644 index 0000000..eb7deeb --- /dev/null +++ b/qa/libcmis/data/atom/type-docLevel2.xml @@ -0,0 +1,675 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>Document Level 2</atom:title> + <app:edited>2013-01-25T09:46:50Z</app:edited> + <atom:updated>2013-01-25T09:46:50Z</atom:updated> + <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xsi:type="cmis:cmisTypeDocumentDefinitionType"> + <cmis:id>DocumentLevel2</cmis:id> + <cmis:localName>DocumentLevel2</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 2</cmis:displayName> + <cmis:queryName>DocumentLevel2</cmis:queryName> + <cmis:description>Description of Document Level 2 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>DocumentLevel1</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyHtmlDefinition> + <cmis:id>HtmlProp</cmis:id> + <cmis:localName>HtmlProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Html Property</cmis:displayName> + <cmis:queryName>HtmlProp</cmis:queryName> + <cmis:description>This is a Sample Html Property property.</cmis:description> + <cmis:propertyType>html</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyHtmlDefinition> + <cmis:propertyIdDefinition> + <cmis:id>IdProp</cmis:id> + <cmis:localName>IdProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Id Property</cmis:displayName> + <cmis:queryName>IdProp</cmis:queryName> + <cmis:description>This is a Sample Id Property property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>DateTimePropMV</cmis:id> + <cmis:localName>DateTimePropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample DateTime multi-value Property</cmis:displayName> + <cmis:queryName>DateTimePropMV</cmis:queryName> + <cmis:description>This is a Sample DateTime multi-value Property property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyUriDefinition> + <cmis:id>UriProp</cmis:id> + <cmis:localName>UriProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Uri Property</cmis:displayName> + <cmis:queryName>UriProp</cmis:queryName> + <cmis:description>This is a Sample Uri Property property.</cmis:description> + <cmis:propertyType>uri</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyUriDefinition> + <cmis:propertyDecimalDefinition> + <cmis:id>DecimalProp</cmis:id> + <cmis:localName>DecimalProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Decimal Property</cmis:displayName> + <cmis:queryName>DecimalProp</cmis:queryName> + <cmis:description>This is a Sample Decimal Property property.</cmis:description> + <cmis:propertyType>decimal</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDecimalDefinition> + <cmis:propertyUriDefinition> + <cmis:id>UriPropMV</cmis:id> + <cmis:localName>UriPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Uri multi-value Property</cmis:displayName> + <cmis:queryName>UriPropMV</cmis:queryName> + <cmis:description>This is a Sample Uri multi-value Property property.</cmis:description> + <cmis:propertyType>uri</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyUriDefinition> + <cmis:propertyIdDefinition> + <cmis:id>IdPropMV</cmis:id> + <cmis:localName>IdPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Id Html multi-value Property</cmis:displayName> + <cmis:queryName>IdPropMV</cmis:queryName> + <cmis:description>This is a Sample Id Html multi-value Property property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>PickListProp</cmis:id> + <cmis:localName>PickListProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Pick List Property</cmis:displayName> + <cmis:queryName>PickListProp</cmis:queryName> + <cmis:description>This is a Sample Pick List Property property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + <cmis:defaultValue propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:defaultValue> + <cmis:choice displayName=""> + <cmis:value>red</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>green</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>blue</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>black</cmis:value> + </cmis:choice> + </cmis:propertyStringDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>IntProp</cmis:id> + <cmis:localName>IntProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Int Property</cmis:displayName> + <cmis:queryName>IntProp</cmis:queryName> + <cmis:description>This is a Sample Int Property property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyHtmlDefinition> + <cmis:id>HtmlPropMV</cmis:id> + <cmis:localName>HtmlPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Html multi-value Property</cmis:displayName> + <cmis:queryName>HtmlPropMV</cmis:queryName> + <cmis:description>This is a Sample Html multi-value Property property.</cmis:description> + <cmis:propertyType>html</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyHtmlDefinition> + <cmis:propertyStringDefinition> + <cmis:id>StringProp</cmis:id> + <cmis:localName>StringProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample String Property</cmis:displayName> + <cmis:queryName>StringProp</cmis:queryName> + <cmis:description>This is a Sample String Property property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDecimalDefinition> + <cmis:id>DecimalPropMV</cmis:id> + <cmis:localName>DecimalPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Decimal multi-value Property</cmis:displayName> + <cmis:queryName>DecimalPropMV</cmis:queryName> + <cmis:description>This is a Sample Decimal multi-value Property property.</cmis:description> + <cmis:propertyType>decimal</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDecimalDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>DateTimeProp</cmis:id> + <cmis:localName>DateTimeProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample DateTime Property</cmis:displayName> + <cmis:queryName>DateTimeProp</cmis:queryName> + <cmis:description>This is a Sample DateTime Property property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>BooleanProp</cmis:id> + <cmis:localName>BooleanProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Boolean Property</cmis:displayName> + <cmis:queryName>BooleanProp</cmis:queryName> + <cmis:description>This is a Sample Boolean Property property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>BooleanPropMV</cmis:id> + <cmis:localName>BooleanPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Boolean multi-value Property</cmis:displayName> + <cmis:queryName>BooleanPropMV</cmis:queryName> + <cmis:description>This is a Sample Boolean multi-value Property property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>IntPropMV</cmis:id> + <cmis:localName>IntPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Int multi-value Property</cmis:displayName> + <cmis:queryName>IntPropMV</cmis:queryName> + <cmis:description>This is a Sample Int multi-value Property property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmisra:type> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry" cmisra:id="DocumentLevel2"/> + <atom:link rel="enclosure" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="up" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/types?typeId=DocumentLevel2" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=DocumentLevel2" type="application/cmistree+xml"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:document" type="application/atom+xml;type=entry"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/type-document.xml b/qa/libcmis/data/atom/type-document.xml new file mode 100644 index 0000000..9bd661d --- /dev/null +++ b/qa/libcmis/data/atom/type-document.xml @@ -0,0 +1,402 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>CMIS Document</atom:title> + <app:edited>2013-01-25T09:47:55Z</app:edited> + <atom:updated>2013-01-25T09:47:55Z</atom:updated> + <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xsi:type="cmis:cmisTypeDocumentDefinitionType"> + <cmis:id>cmis:document</cmis:id> + <cmis:localName>cmis:document</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>CMIS Document</cmis:displayName> + <cmis:queryName>cmis:document</cmis:queryName> + <cmis:description>Description of CMIS Document Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmisra:type> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/type?id=cmis:document" type="application/atom+xml;type=entry" cmisra:id="cmis:document"/> + <atom:link rel="enclosure" href="http://mockup/mock/type?id=cmis:document" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/types?typeId=cmis:document" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=cmis:document" type="application/cmistree+xml"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:document" type="application/atom+xml;type=entry"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/type-folder.xml b/qa/libcmis/data/atom/type-folder.xml new file mode 100644 index 0000000..5aed5ae --- /dev/null +++ b/qa/libcmis/data/atom/type-folder.xml @@ -0,0 +1,224 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>CMIS Folder</atom:title> + <app:edited>2012-11-29T16:39:44Z</app:edited> + <atom:updated>2012-11-29T16:39:44Z</atom:updated> + <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xsi:type="cmis:cmisTypeFolderDefinitionType"> + <cmis:id>cmis:folder</cmis:id> + <cmis:localName>cmis:folder</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>CMIS Folder</cmis:displayName> + <cmis:queryName>cmis:folder</cmis:queryName> + <cmis:description>Description of CMIS Folder Type</cmis:description> + <cmis:baseId>cmis:folder</cmis:baseId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyIdDefinition> + <cmis:id>cmis:allowedChildObjectTypeIds</cmis:id> + <cmis:localName>cmis:allowedChildObjectTypeIds</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Allowed Child Types</cmis:displayName> + <cmis:queryName>cmis:allowedChildObjectTypeIds</cmis:queryName> + <cmis:description>This is a Allowed Child Types property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:path</cmis:id> + <cmis:localName>cmis:path</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Path</cmis:displayName> + <cmis:queryName>cmis:path</cmis:queryName> + <cmis:description>This is a Path property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:parentId</cmis:id> + <cmis:localName>cmis:parentId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Parent Id</cmis:displayName> + <cmis:queryName>cmis:parentId</cmis:queryName> + <cmis:description>This is a Parent Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + </cmisra:type> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry" cmisra:id="cmis:folder"/> + <atom:link rel="enclosure" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/types?typeId=cmis:folder" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=cmis:folder" type="application/cmistree+xml"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis:folder" type="application/atom+xml;type=entry"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/typechildren-docLevel1.xml b/qa/libcmis/data/atom/typechildren-docLevel1.xml new file mode 100644 index 0000000..0d15971 --- /dev/null +++ b/qa/libcmis/data/atom/typechildren-docLevel1.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>Document Level 1</atom:title> + <app:edited>2013-01-25T10:11:03Z</app:edited> + <atom:updated>2013-01-25T10:11:03Z</atom:updated> + <cmisra:numItems>1</cmisra:numItems> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/types?typeId=DocumentLevel1&includePropertyDefinitions=false" type="application/atom+xml;type=entry" cmisra:id="DocumentLevel1"/> + <atom:link rel="via" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=DocumentLevel1" type="application/cmistree+xml"/> + <atom:link rel="up" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> + <atom:link rel="next" href="http://mockup/mock/types?typeId=DocumentLevel1&includePropertyDefinitions=false&skipCount=100&maxItems=100" type="application/atom+xml;type=feed"/> + <app:collection href="http://mockup/mock/types?typeId=DocumentLevel1"> + <atom:title type="text">Types Collection</atom:title> + <app:accept/> + </app:collection> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>Document Level 2</atom:title> + <app:edited>2013-01-25T10:11:03Z</app:edited> + <atom:updated>2013-01-25T10:11:03Z</atom:updated> + <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xsi:type="cmis:cmisTypeDocumentDefinitionType"> + <cmis:id>DocumentLevel2</cmis:id> + <cmis:localName>DocumentLevel2</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 2</cmis:displayName> + <cmis:queryName>DocumentLevel2</cmis:queryName> + <cmis:description>Description of Document Level 2 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>DocumentLevel1</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmisra:type> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry" cmisra:id="DocumentLevel2"/> + <atom:link rel="enclosure" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="up" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/types?typeId=DocumentLevel2" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=DocumentLevel2" type="application/cmistree+xml"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> + </atom:entry> +</atom:feed> diff --git a/qa/libcmis/data/atom/typechildren-document.xml b/qa/libcmis/data/atom/typechildren-document.xml new file mode 100644 index 0000000..b60c1b4 --- /dev/null +++ b/qa/libcmis/data/atom/typechildren-document.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>CMIS Document</atom:title> + <app:edited>2013-01-25T10:05:56Z</app:edited> + <atom:updated>2013-01-25T10:05:56Z</atom:updated> + <cmisra:numItems>1</cmisra:numItems> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/types?typeId=cmis:document&includePropertyDefinitions=false" type="application/atom+xml;type=entry" cmisra:id="cmis:document"/> + <atom:link rel="via" href="http://mockup/mock/type?id=cmis:document" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=cmis:document" type="application/cmistree+xml"/> + <atom:link rel="next" href="http://mockup/mock/types?typeId=cmis:document&includePropertyDefinitions=false&skipCount=100&maxItems=100" type="application/atom+xml;type=feed"/> + <app:collection href="http://mockup/mock/types?typeId=cmis:document"> + <atom:title type="text">Types Collection</atom:title> + <app:accept/> + </app:collection> + <atom:entry> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>http://mockup/mock/obscure id</atom:id> + <atom:title>Document Level 1</atom:title> + <app:edited>2013-01-25T10:05:56Z</app:edited> + <atom:updated>2013-01-25T10:05:56Z</atom:updated> + <cmisra:type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xsi:type="cmis:cmisTypeDocumentDefinitionType"> + <cmis:id>DocumentLevel1</cmis:id> + <cmis:localName>DocumentLevel1</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 1</cmis:displayName> + <cmis:queryName>DocumentLevel1</cmis:queryName> + <cmis:description>Description of Document Level 1 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>cmis:document</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmisra:type> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry" cmisra:id="DocumentLevel1"/> + <atom:link rel="enclosure" href="http://mockup/mock/type?id=DocumentLevel1" type="application/atom+xml;type=entry"/> + <atom:link rel="up" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> + <atom:link rel="down" href="http://mockup/mock/types?typeId=DocumentLevel1" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/typedesc?typeId=DocumentLevel1" type="application/cmistree+xml"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Adocument" type="application/atom+xml;type=entry"/> + </atom:entry> +</atom:feed> diff --git a/qa/libcmis/data/atom/valid-object-noactions.xml b/qa/libcmis/data/atom/valid-object-noactions.xml new file mode 100644 index 0000000..697c2a7 --- /dev/null +++ b/qa/libcmis/data/atom/valid-object-noactions.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2012-11-29T16:14:47Z</atom:published> + <atom:title>Valid Object</atom:title> + <app:edited>2012-11-29T16:14:47Z</app:edited> + <atom:updated>2012-11-29T16:14:47Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Valid Object</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Valid Object</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>valid-object</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://my/cmis/extension" xmlns:exampleExtension="http://my/cmis/extension"> + <objectId xmlns:ns0="http://my/cmis/extension" ns0:type="cmis:folder">valid-object</objectId> + <name>Valid Object</name> + </exampleExtension:exampleExtension> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=valid-object" type="application/atom+xml;type=entry" cmisra:id="valid-object"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=valid-object" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=valid-object" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Afolder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=valid-object" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=valid-object" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/children?id=valid-object" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=valid-object" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=valid-object" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=valid-object" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/valid-object.xml b/qa/libcmis/data/atom/valid-object.xml new file mode 100644 index 0000000..65815b3 --- /dev/null +++ b/qa/libcmis/data/atom/valid-object.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>Admin</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2012-11-29T16:14:47Z</atom:published> + <atom:title>Valid Object</atom:title> + <app:edited>2012-11-29T16:14:47Z</app:edited> + <atom:updated>2012-11-29T16:14:47Z</atom:updated> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Valid Object</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Valid Object</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>valid-object</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>true</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>true</cmis:canGetFolderParent> + <cmis:canGetDescendants>true</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>false</cmis:canDeleteContentStream> + <cmis:canCheckOut>false</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>false</cmis:canSetContentStream> + <cmis:canGetAllVersions>false</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>false</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>false</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>false</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>true</cmis:canGetChildren> + <cmis:canCreateDocument>true</cmis:canCreateDocument> + <cmis:canCreateFolder>true</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>true</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://my/cmis/extension" xmlns:exampleExtension="http://my/cmis/extension"> + <objectId xmlns:ns0="http://my/cmis/extension" ns0:type="cmis:folder">valid-object</objectId> + <name>Valid Object</name> + </exampleExtension:exampleExtension> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=valid-object" type="application/atom+xml;type=entry" cmisra:id="valid-object"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=valid-object" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=valid-object" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=cmis%3Afolder" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=valid-object" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=valid-object" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/children?id=valid-object" type="application/atom+xml;type=feed"/> + <atom:link rel="down" href="http://mockup/mock/descendants?id=valid-object" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=valid-object" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=valid-object" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/working-copy.xml b/qa/libcmis/data/atom/working-copy.xml new file mode 100644 index 0000000..42a9bc7 --- /dev/null +++ b/qa/libcmis/data/atom/working-copy.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> + <atom:author> + <atom:name>unknown</atom:name> + </atom:author> + <atom:id>Some obscure Id</atom:id> + <atom:published>2013-05-21T13:50:45Z</atom:published> + <atom:title>Test Document</atom:title> + <app:edited>2013-05-21T13:50:45Z</app:edited> + <atom:updated>2013-05-21T13:50:45Z</atom:updated> + <atom:content src="http://mockup/mock/content/data.txt?id=working-copy" type="text/plain"/> + <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:properties> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"> + <cmis:value>working-copy</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="VersionedStringProp" displayName="Sample String Property" localName="VersionedStringProp" propertyDefinitionId="VersionedStringProp"/> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>version-series</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-05-21T13:50:45.300Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1369144245300</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>V 0.2</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>working-copy</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-05-21T13:50:45.300Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">working-copy</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmisra:object> + <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> + <atom:link rel="self" href="http://mockup/mock/id?id=working-copy" type="application/atom+xml;type=entry" cmisra:id="working-copy"/> + <atom:link rel="enclosure" href="http://mockup/mock/id?id=working-copy" type="application/atom+xml;type=entry"/> + <atom:link rel="edit" href="http://mockup/mock/id?id=working-copy" type="application/atom+xml;type=entry"/> + <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=working-copy" type="application/cmisallowableactions+xml"/> + <atom:link rel="up" href="http://mockup/mock/parents?id=working-copy" type="application/atom+xml;type=feed"/> + <atom:link rel="version-history" href="http://mockup/mock/versions?id=working-copy&versionSeries=version-series" type="application/atom+xml;type=feed"/> + <atom:link rel="edit-media" href="http://mockup/mock/content?id=working-copy" type="text/plain"/> + <atom:link rel="working-copy" href="http://mockup/mock/id?id=working-copy" type="application/atom+xml;type=entry"/> + <atom:link rel="via" href="http://mockup/mock/id?id=working-copy" type="application/atom+xml;type=entry"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=working-copy" type="application/cmisacl+xml"/> +</atom:entry> diff --git a/qa/libcmis/data/atom/workspaces.xml b/qa/libcmis/data/atom/workspaces.xml new file mode 100644 index 0000000..1448776 --- /dev/null +++ b/qa/libcmis/data/atom/workspaces.xml @@ -0,0 +1,238 @@ +<?xml version="1.0" encoding="UTF-8"?> +<app:service xmlns:app="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"> + <app:workspace> + <atom:title>Mockup</atom:title> + <app:collection href="http://mockup/mock/children?id=root"> + <cmisra:collectionType>root</cmisra:collectionType> + <atom:title type="text">Root Collection</atom:title> + <app:accept>application/atom+xml;type=entry</app:accept> + <app:accept>application/cmisatom+xml</app:accept> + </app:collection> + <app:collection href="http://mockup/mock/types"> + <cmisra:collectionType>types</cmisra:collectionType> + <atom:title type="text">Types Collection</atom:title> + <app:accept/> + </app:collection> + <app:collection href="http://mockup/mock/query"> + <cmisra:collectionType>query</cmisra:collectionType> + <atom:title type="text">Query Collection</atom:title> + <app:accept>application/cmisquery+xml</app:accept> + </app:collection> + <app:collection href="http://mockup/mock/checkedout"> + <cmisra:collectionType>checkedout</cmisra:collectionType> + <atom:title type="text">Checked Out Collection</atom:title> + <app:accept>application/cmisatom+xml</app:accept> + </app:collection> + <app:collection href="http://mockup/mock/unfiled"> + <cmisra:collectionType>unfiled</cmisra:collectionType> + <atom:title type="text">Unfiled Collection</atom:title> + <app:accept>application/cmisatom+xml</app:accept> + </app:collection> + <cmisra:repositoryInfo xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmis:repositoryId>mock</cmis:repositoryId> + <cmis:repositoryName>Mockup</cmis:repositoryName> + <cmis:repositoryDescription>Repository sent by mockup server</cmis:repositoryDescription> + <cmis:vendorName>libcmis</cmis:vendorName> + <cmis:productName>Libcmis mockup</cmis:productName> + <cmis:productVersion>some-version</cmis:productVersion> + <cmis:rootFolderId>root-folder</cmis:rootFolderId> + <cmis:latestChangeLogToken>0</cmis:latestChangeLogToken> + <cmis:capabilities> + <cmis:capabilityACL>manage</cmis:capabilityACL> + <cmis:capabilityAllVersionsSearchable>false</cmis:capabilityAllVersionsSearchable> + <cmis:capabilityChanges>none</cmis:capabilityChanges> + <cmis:capabilityContentStreamUpdatability>anytime</cmis:capabilityContentStreamUpdatability> + <cmis:capabilityGetDescendants>true</cmis:capabilityGetDescendants> + <cmis:capabilityGetFolderTree>true</cmis:capabilityGetFolderTree> + <cmis:capabilityMultifiling>true</cmis:capabilityMultifiling> + <cmis:capabilityPWCSearchable>false</cmis:capabilityPWCSearchable> + <cmis:capabilityPWCUpdatable>true</cmis:capabilityPWCUpdatable> + <cmis:capabilityQuery>bothcombined</cmis:capabilityQuery> + <cmis:capabilityRenditions>none</cmis:capabilityRenditions> + <cmis:capabilityUnfiling>true</cmis:capabilityUnfiling> + <cmis:capabilityVersionSpecificFiling>false</cmis:capabilityVersionSpecificFiling> + <cmis:capabilityJoin>none</cmis:capabilityJoin> + </cmis:capabilities> + <cmis:aclCapability> + <cmis:supportedPermissions>basic</cmis:supportedPermissions> + <cmis:propagation>objectonly</cmis:propagation> + <cmis:permissions> + <cmis:permission>cmis:read</cmis:permission> + <cmis:description>Read</cmis:description> + </cmis:permissions> + <cmis:permissions> + <cmis:permission>cmis:write</cmis:permission> + <cmis:description>Write</cmis:description> + </cmis:permissions> + <cmis:permissions> + <cmis:permission>cmis:all</cmis:permission> + <cmis:description>All</cmis:description> + </cmis:permissions> + <cmis:mapping> + <cmis:key>canGetDescendents.Folder</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetChildren.Folder</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetParents.Folder</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetFolderParent.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateDocument.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateFolder.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateRelationship.Source</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateRelationship.Target</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetProperties.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canViewContent.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canUpdateProperties.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canMove.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canMove.Target</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canMove.Source</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canDelete.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canDeleteTree.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canSetContent.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canDeleteContent.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddToFolder.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddToFolder.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemoveFromFolder.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemoveFromFolder.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCheckout.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCancelCheckout.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCheckin.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetAllVersions.VersionSeries</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetObjectRelationships.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddPolicy.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddPolicy.Policy</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemovePolicy.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemovePolicy.Policy</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetAppliedPolicies.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetACL.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canApplyACL.Object</cmis:key> + <cmis:permission>cmis:all</cmis:permission> + </cmis:mapping> + </cmis:aclCapability> + <cmis:cmisVersionSupported>1.1</cmis:cmisVersionSupported> + <cmis:thinClientURI/> + <cmis:changesIncomplete>true</cmis:changesIncomplete> + <cmis:principalAnonymous>anonymous</cmis:principalAnonymous> + <cmis:principalAnyone>anyone</cmis:principalAnyone> + </cmisra:repositoryInfo> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/typedescendants" href="http://mockup/mock/typedesc" type="application/atom+xml;type=feed"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/foldertree" href="http://mockup/mock/foldertree?id=root" type="application/cmistree+xml"/> + <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/rootdescendants" href="http://mockup/mock/descendants?id=root" type="application/cmistree+xml" cmisra:id="root"/> + <cmisra:uritemplate> + <cmisra:template>http://mockup/mock/id?id={id}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}&includePolicyIds={includePolicyIds}&includeRelationships={includeRelationships}&renditionFilter={renditionFilter}</cmisra:template> + <cmisra:type>objectbyid</cmisra:type> + <cmisra:mediatype>application/atom+xml;type=entry</cmisra:mediatype> + </cmisra:uritemplate> + <cmisra:uritemplate> + <cmisra:template>http://mockup/mock/path?path={path}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}&includePolicyIds={includePolicyIds}&includeRelationships={includeRelationships}&renditionFilter={renditionFilter}</cmisra:template> + <cmisra:type>objectbypath</cmisra:type> + <cmisra:mediatype>application/atom+xml;type=entry</cmisra:mediatype> + </cmisra:uritemplate> + <cmisra:uritemplate> + <cmisra:template>http://mockup/mock/type?id={id}</cmisra:template> + <cmisra:type>typebyid</cmisra:type> + <cmisra:mediatype>application/atom+xml;type=entry</cmisra:mediatype> + </cmisra:uritemplate> + <cmisra:uritemplate> + <cmisra:template>http://mockup/mock/query?q={q}&searchAllVersions={searchAllVersions}&includeAllowableActions={includeAllowableActions}&includeRelationships={includeRelationships}&maxItems={maxItems}&skipCount={skipCount}</cmisra:template> + <cmisra:type>query</cmisra:type> + <cmisra:mediatype>application/atom+xml;type=feed</cmisra:mediatype> + </cmisra:uritemplate> + </app:workspace> +</app:service> diff --git a/qa/libcmis/data/gdrive/allVersions.json b/qa/libcmis/data/gdrive/allVersions.json new file mode 100644 index 0000000..cdbba67 --- /dev/null +++ b/qa/libcmis/data/gdrive/allVersions.json @@ -0,0 +1,49 @@ +{ + "kind": "drive#revisionList", + "etag": "revisionEtag", + "selfLink": "revisionsLink", + "items": [ + { + "kind": "drive#revision", + "etag": "\"anEtag\"", + "id": "versionId0", + "selfLink": "aSelfLink", + "mimeType": "application/vnd.google-apps.form", + "modifiedDate": "2010-07-04T12:30:07.355Z", + "published": false, + "exportLinks": { + "application/pdf": "pdfLink", + "application/x-vnd.oasis.opendocument.spreadsheet": "ODFLinks", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "msLink" + } + }, + { + "kind": "drive#revision", + "etag": "\"anEtag\"", + "id": "versionId1", + "selfLink": "aSelfLink", + "mimeType": "application/vnd.google-apps.form", + "modifiedDate": "2010-07-04T12:30:07.355Z", + "published": false, + "exportLinks": { + "application/pdf": "pdfLink", + "application/x-vnd.oasis.opendocument.spreadsheet": "ODFLinks", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "msLink" + } + }, + { + "kind": "drive#revision", + "etag": "\"anEtag\"", + "id": "versionId2", + "selfLink": "aSelfLink", + "mimeType": "application/vnd.google-apps.form", + "modifiedDate": "2010-07-04T12:30:07.355Z", + "published": false, + "exportLinks": { + "application/pdf": "pdfLink", + "application/x-vnd.oasis.opendocument.spreadsheet": "ODFLinks", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "msLink" + } + } + ] +} diff --git a/qa/libcmis/data/gdrive/approve.html b/qa/libcmis/data/gdrive/approve.html new file mode 100644 index 0000000..cf4959b --- /dev/null +++ b/qa/libcmis/data/gdrive/approve.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> +<body> +<form action="https://approval/url" method="POST" id="submit_access_form"> +<input id="state_wrapper" name="state_wrapper" value="stateWrapper" type="hidden"> +<input id="submit_access" name="submit_access" value="" type="hidden"> + +</form> +</body> +</html> diff --git a/qa/libcmis/data/gdrive/authcode.html b/qa/libcmis/data/gdrive/authcode.html new file mode 100644 index 0000000..7d28ba1 --- /dev/null +++ b/qa/libcmis/data/gdrive/authcode.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> +<body> +<input id="code" readonly="readonly" value="AuthCode"> +</body> +</html> diff --git a/qa/libcmis/data/gdrive/challenge.html b/qa/libcmis/data/gdrive/challenge.html new file mode 100644 index 0000000..a92124d --- /dev/null +++ b/qa/libcmis/data/gdrive/challenge.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html lang="en"> +<body> +<form novalidate="" id="skip" action="/signin/challenge/skip" method="post"> + <input id="skipChallenge" type="submit"> +</form> +<form novalidate="" id="resend" action="/signin/challenge" method="post"> + <input name="subAction" type="hidden" value="startChallenge"> + <input name="challengeId" type="hidden" value="1"> +</form> +<form novalidate="" id="challenge" action="/challenge/url" method="post"> + <input name="continue" id="continue" value="redirectLink&scope=Scope" type="hidden"> + <input name="service" id="service" value="lso" type="hidden"> + <input name="GALX" value="cookie" type="hidden"> + <input name="Pin" id="Pin"> +</form> +<form novalidate="" id="select_challenge" action="/signin/selectchallenge" method="post"> + <input id="selectChallenge" type="submit"> +</form> +</body> +</html> diff --git a/qa/libcmis/data/gdrive/document-updated.json b/qa/libcmis/data/gdrive/document-updated.json new file mode 100644 index 0000000..e60ee79 --- /dev/null +++ b/qa/libcmis/data/gdrive/document-updated.json @@ -0,0 +1,67 @@ +{ + "kind": "drive#file", + "id": "aFileId", + "etag": "\"an example tag\"", + "selfLink": "fileSelfLink", + "title": "New Title", + "mimeType": "application/vnd.google-apps.form", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2010-04-28T14:53:23.141Z", + "modifiedDate": "2010-09-30T21:01:37.504Z", + "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", + "fileSize": "123", + "parents": [ + { + "kind": "drive#parentReference", + "id": "aFolderId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + }, + { + "kind": "drive#parentReference", + "id": "aNewFolderId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + } + ], + "exportLinks": { + "application/pdf": "pdflink", + "application/x-vnd.oasis.opendocument.spreadsheet": "https://downloadLink", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" + }, + "thumbnailLink": "https://aThumbnailLink", + "userPermission": { + "kind": "drive#permission", + "id": "me", + "role": "owner", + "type": "user" + }, + "quotaBytesUsed": "0", + "ownerNames": [ + "Owner Real Name" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "Mock file owner", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "Mock user", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": false + }, + "editable": true, + "writersCanShare": true, + "shared": true +} diff --git a/qa/libcmis/data/gdrive/document.json b/qa/libcmis/data/gdrive/document.json new file mode 100644 index 0000000..016a5bd --- /dev/null +++ b/qa/libcmis/data/gdrive/document.json @@ -0,0 +1,67 @@ +{ + "kind": "drive#file", + "id": "aFileId", + "etag": "\"an example tag\"", + "selfLink": "fileSelfLink", + "title": "GDrive File", + "mimeType": "application/vnd.google-apps.form", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2010-04-28T14:53:23.141Z", + "modifiedDate": "2010-09-30T21:01:37.504Z", + "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", + "fileSize": "123", + "parents": [ + { + "kind": "drive#parentReference", + "id": "aFolderId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + }, + { + "kind": "drive#parentReference", + "id": "aNewFolderId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + } + ], + "exportLinks": { + "application/pdf": "pdflink", + "application/x-vnd.oasis.opendocument.spreadsheet": "https://downloadLink", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" + }, + "thumbnailLink": "https://aThumbnailLink", + "userPermission": { + "kind": "drive#permission", + "id": "me", + "role": "owner", + "type": "user" + }, + "quotaBytesUsed": "0", + "ownerNames": [ + "Owner Real Name" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "Mock file owner", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "Mock user", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": false + }, + "editable": true, + "writersCanShare": true, + "shared": true +} diff --git a/qa/libcmis/data/gdrive/document2.json b/qa/libcmis/data/gdrive/document2.json new file mode 100644 index 0000000..c55475e --- /dev/null +++ b/qa/libcmis/data/gdrive/document2.json @@ -0,0 +1,62 @@ +{ + "kind": "drive#file", + "id": "aFileId", + "etag": "\"an example tag\"", + "selfLink": "fileSelfLink", + "title": "GDrive File", + "mimeType": "application/vnd.google-apps.form", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2010-04-28T14:53:23.141Z", + "modifiedDate": "2010-09-30T21:01:37.504Z", + "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", + "fileSize": "123", + "downloadUrl": "https://download/url", + "parents": [ + { + "kind": "drive#parentReference", + "id": "aFolderId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + }, + { + "kind": "drive#parentReference", + "id": "anotherFolderId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + } + ], + "userPermission": { + "kind": "drive#permission", + "id": "me", + "role": "owner", + "type": "user" + }, + "quotaBytesUsed": "0", + "ownerNames": [ + "Owner Real Name" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "Mock file owner", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "Mock user", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": false + }, + "editable": true, + "writersCanShare": true, + "shared": true +} diff --git a/qa/libcmis/data/gdrive/document_parents.json b/qa/libcmis/data/gdrive/document_parents.json new file mode 100644 index 0000000..21c033f --- /dev/null +++ b/qa/libcmis/data/gdrive/document_parents.json @@ -0,0 +1,14 @@ +{ + "kind": "drive#parentList", + "etag": "A parent etag", + "selfLink": "SelfLink", + "items": [ + { + "kind": "drive#parentReference", + "id": "aFolderId", + "selfLink": "aSelfLink", + "parentLink": "AParentLink", + "isRoot": true + } + ] +} diff --git a/qa/libcmis/data/gdrive/folder.json b/qa/libcmis/data/gdrive/folder.json new file mode 100644 index 0000000..2b07a48 --- /dev/null +++ b/qa/libcmis/data/gdrive/folder.json @@ -0,0 +1,47 @@ +{ + "kind": "drive#file", + "id": "aFolderId", + "etag": "a folder etag", + "selfLink": "SelfLINK", + "title": "testFolder", + "mimeType": "application/vnd.google-apps.folder", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2013-03-22T17:53:10.290Z", + "modifiedDate": "2013-03-22T17:53:44.212Z", + "modifiedByMeDate": "2013-03-22T17:53:44.212Z", + "lastViewedByMeDate": "2013-04-05T15:27:47.261Z", + "parents": [ + { + "kind": "drive#parentReference", + "id": "parentID", + "isRoot": true + } + ], + "quotaBytesUsed": "0", + "ownerNames": [ + "User" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "User name of the last person modify", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "Last mofifying username", + "isAuthenticatedUser": true + }, + "editable": true, + "writersCanShare": true, + "shared": false, + "appDataContents": false +} diff --git a/qa/libcmis/data/gdrive/folder2.json b/qa/libcmis/data/gdrive/folder2.json new file mode 100644 index 0000000..1f54206 --- /dev/null +++ b/qa/libcmis/data/gdrive/folder2.json @@ -0,0 +1,47 @@ +{ + "kind": "drive#file", + "id": "aNewFolderId", + "etag": "a folder etag", + "selfLink": "SelfLINK", + "title": "testFolder", + "mimeType": "application/vnd.google-apps.folder", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2013-03-22T17:53:10.290Z", + "modifiedDate": "2013-03-22T17:53:44.212Z", + "modifiedByMeDate": "2013-03-22T17:53:44.212Z", + "lastViewedByMeDate": "2013-04-05T15:27:47.261Z", + "parents": [ + { + "kind": "drive#parentReference", + "id": "parentID", + "isRoot": true + } + ], + "quotaBytesUsed": "0", + "ownerNames": [ + "User" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "User name of the last person modify", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "Last mofifying username", + "isAuthenticatedUser": true + }, + "editable": true, + "writersCanShare": true, + "shared": false, + "appDataContents": false +} diff --git a/qa/libcmis/data/gdrive/folder_children.json b/qa/libcmis/data/gdrive/folder_children.json new file mode 100644 index 0000000..55604e3 --- /dev/null +++ b/qa/libcmis/data/gdrive/folder_children.json @@ -0,0 +1,20 @@ +{ + "kind": "drive#childrenList", + "etag": "A children etag", + "selfLink": "SelfLink", + "items": [ + { + "kind": "drive#childrenReference", + "id": "aChildFolder", + "mimeType": "application/vnd.google-apps.folder", + "selfLink": "aSelfLink", + "childLink": "AchildrenLink" + }, + { + "kind": "drive#childrenReference", + "id": "aChildDocument", + "selfLink": "aSelfLink2", + "childLink": "AchildrenLink2" + } + ] +} diff --git a/qa/libcmis/data/gdrive/gdoc-file.json b/qa/libcmis/data/gdrive/gdoc-file.json new file mode 100644 index 0000000..b55690e --- /dev/null +++ b/qa/libcmis/data/gdrive/gdoc-file.json @@ -0,0 +1,58 @@ +{ + "kind": "drive#file", + "id": "aFileId", + "etag": "\"an example tag\"", + "selfLink": "fileSelfLink", + "title": "a file title", + "mimeType": "application/vnd.google-apps.form", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2010-04-28T14:53:23.141Z", + "modifiedDate": "2010-09-30T21:01:37.504Z", + "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", + "parents": [ + { + "kind": "drive#parentReference", + "id": "parentId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + } + ], + "exportLinks": { + "application/pdf": "pdflink", + "application/x-vnd.oasis.opendocument.spreadsheet": "opendocumentlinks", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" + }, + "userPermission": { + "kind": "drive#permission", + "id": "me", + "role": "owner", + "type": "user" + }, + "quotaBytesUsed": "0", + "ownerNames": [ + "Owner Real Name" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "Mock file owner", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "Mock user", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": false + }, + "editable": true, + "writersCanShare": true, + "shared": true +} diff --git a/qa/libcmis/data/gdrive/jsontest-good.json b/qa/libcmis/data/gdrive/jsontest-good.json new file mode 100644 index 0000000..939e599 --- /dev/null +++ b/qa/libcmis/data/gdrive/jsontest-good.json @@ -0,0 +1,60 @@ +{ + "kind": "drive#file", + "id": "aFileId", + "etag": "\"an example tag\"", + "selfLink": "fileSelfLink", + "title": "a file title", + "mimeType": "application/vnd.google-apps.form", + "labels": { + "starred": false, + "hidden": false, + "trashed": false, + "restricted": false, + "viewed": true + }, + "createdDate": "2010-04-28T14:53:23.141Z", + "modifiedDate": "2010-09-30T21:01:37.504Z", + "lastViewedByMeDate": "2013-02-26T15:40:30.404Z", + "intTest": "-123", + "doubleTest": "-123.456", + "parents": [ + { + "kind": "drive#parentReference", + "id": "parentId", + "selfLink": "parentSelfLink", + "parentLink": "parentLink", + "isRoot": true + } + ], + "exportLinks": { + "application/pdf": "pdflink", + "application/x-vnd.oasis.opendocument.spreadsheet": "opendocumentlinks", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlslink" + }, + "userPermission": { + "kind": "drive#permission", + "id": "me", + "role": "owner", + "type": "user" + }, + "quotaBytesUsed": "0", + "ownerNames": [ + "Owner Real Name" + ], + "owners": [ + { + "kind": "drive#user", + "displayName": "Mock file owner", + "isAuthenticatedUser": true + } + ], + "lastModifyingUserName": "Mock user", + "lastModifyingUser": { + "kind": "drive#user", + "displayName": "User name", + "isAuthenticatedUser": false + }, + "editable": true, + "writersCanShare": true, + "shared": true +} diff --git a/qa/libcmis/data/gdrive/login1.html b/qa/libcmis/data/gdrive/login1.html new file mode 100644 index 0000000..b6da338 --- /dev/null +++ b/qa/libcmis/data/gdrive/login1.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html lang="en"> +<body> +<form novalidate="" id="gaia_loginform" action="https://login2/url" method="post"> + <input name="Page" type="hidden" value="PasswordSeparationSignIn"> + <input name="continue" id="continue" value="redirectLink&scope=Scope" type="hidden"> + <input name="service" id="service" value="lso" type="hidden"> + <input name="GALX" value="cookie" type="hidden"> + <input spellcheck="false" name="Email" id="Email" value="" type="email"> +</form> +</body> +</html> diff --git a/qa/libcmis/data/gdrive/login2.html b/qa/libcmis/data/gdrive/login2.html new file mode 100644 index 0000000..6425091 --- /dev/null +++ b/qa/libcmis/data/gdrive/login2.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html lang="en"> +<body> +<form novalidate="" id="gaia_loginform" action="https://login/url" method="post"> + <input name="continue" id="continue" value="redirectLink&scope=Scope" type="hidden"> + <input name="service" id="service" value="lso" type="hidden"> + <input name="GALX" value="cookie" type="hidden"> + <input name="Passwd" id="Passwd" type="password"> +</form> +</body> +</html> diff --git a/qa/libcmis/data/gdrive/refresh_response.json b/qa/libcmis/data/gdrive/refresh_response.json new file mode 100644 index 0000000..d4afc4b --- /dev/null +++ b/qa/libcmis/data/gdrive/refresh_response.json @@ -0,0 +1,5 @@ +{ + "access_token":"new-access-token", + "expires_in":3920, + "token_type":"Bearer" +} diff --git a/qa/libcmis/data/gdrive/root_child_missing.json b/qa/libcmis/data/gdrive/root_child_missing.json new file mode 100644 index 0000000..3659806 --- /dev/null +++ b/qa/libcmis/data/gdrive/root_child_missing.json @@ -0,0 +1,4 @@ +{ + "items": [ + ] +} diff --git a/qa/libcmis/data/gdrive/root_child_search.json b/qa/libcmis/data/gdrive/root_child_search.json new file mode 100644 index 0000000..79f5031 --- /dev/null +++ b/qa/libcmis/data/gdrive/root_child_search.json @@ -0,0 +1,13 @@ +{ + "kind": "drive#childrenList", + "etag": "A children etag", + "selfLink": "SelfLink", + "items": [ + { + "kind": "drive#childrenReference", + "id": "aRootChildId2", + "selfLink": "aSelfLink2", + "childLink": "AchildrenLink2" + } + ] +} diff --git a/qa/libcmis/data/gdrive/token-response.json b/qa/libcmis/data/gdrive/token-response.json new file mode 100644 index 0000000..36b233c --- /dev/null +++ b/qa/libcmis/data/gdrive/token-response.json @@ -0,0 +1,6 @@ +{ + "access_token":"mock-access-token", + "expires_in":3920, + "token_type":"Bearer", + "refresh_token":"mock-refresh-token" +}
\ No newline at end of file diff --git a/qa/libcmis/data/onedrive/file.json b/qa/libcmis/data/onedrive/file.json new file mode 100644 index 0000000..29e42e9 --- /dev/null +++ b/qa/libcmis/data/onedrive/file.json @@ -0,0 +1,24 @@ +{ + "id": "aFileId", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDriveFile", + "description": "short description", + "parent_id": "aParentId", + "size": 42, + "upload_location": "https://base/url/aFileId/content", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "source": "sourceUrl", + "link": "linkUrl", + "type": "file", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/folder-listed.json b/qa/libcmis/data/onedrive/folder-listed.json new file mode 100644 index 0000000..ce66c4e --- /dev/null +++ b/qa/libcmis/data/onedrive/folder-listed.json @@ -0,0 +1,51 @@ +{ + "data": [ + { + "id": "aFolderId", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDrive Folder", + "description": "short description", + "parent_id": "aParentId", + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "link": "linkUrl", + "type": "folder", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" + }, + { + "id": "aFileId", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDrive File", + "description": "short description", + "parent_id": "aParentId", + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "source": "sourceUrl", + "link": "linkUrl", + "type": "file", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" + } + ] +} diff --git a/qa/libcmis/data/onedrive/folder.json b/qa/libcmis/data/onedrive/folder.json new file mode 100644 index 0000000..576ad10 --- /dev/null +++ b/qa/libcmis/data/onedrive/folder.json @@ -0,0 +1,23 @@ +{ + "id": "aFolderId", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDrive Folder", + "description": "short description", + "parent_id": "aParentId", + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "link": "linkUrl", + "type": "folder", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/folderA.json b/qa/libcmis/data/onedrive/folderA.json new file mode 100644 index 0000000..d44cdf3 --- /dev/null +++ b/qa/libcmis/data/onedrive/folderA.json @@ -0,0 +1,23 @@ +{ + "id": "folderA", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "SkyDrive", + "description": "short description", + "parent_id": null, + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "link": "linkUrl", + "type": "folder", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/folderB.json b/qa/libcmis/data/onedrive/folderB.json new file mode 100644 index 0000000..1a69b00 --- /dev/null +++ b/qa/libcmis/data/onedrive/folderB.json @@ -0,0 +1,23 @@ +{ + "id": "folderB", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "Folder B", + "description": "short description", + "parent_id": "folderA", + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "link": "linkUrl", + "type": "folder", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/folderC.json b/qa/libcmis/data/onedrive/folderC.json new file mode 100644 index 0000000..f7b9854 --- /dev/null +++ b/qa/libcmis/data/onedrive/folderC.json @@ -0,0 +1,23 @@ +{ + "id": "folderC", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "Folder C", + "description": "short description", + "parent_id": "folderB", + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "link": "linkUrl", + "type": "folder", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/new-file.json b/qa/libcmis/data/onedrive/new-file.json new file mode 100644 index 0000000..0564a51 --- /dev/null +++ b/qa/libcmis/data/onedrive/new-file.json @@ -0,0 +1,5 @@ +{ + "id": "aFileId", + "name": "OneDrive File", + "source": "sourceUrl" +} diff --git a/qa/libcmis/data/onedrive/parent-folder.json b/qa/libcmis/data/onedrive/parent-folder.json new file mode 100644 index 0000000..972c926 --- /dev/null +++ b/qa/libcmis/data/onedrive/parent-folder.json @@ -0,0 +1,23 @@ +{ + "id": "aParentId", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDrive Folder", + "description": "short description", + "parent_id": null, + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "link": "linkUrl", + "type": "folder", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/refresh-response.json b/qa/libcmis/data/onedrive/refresh-response.json new file mode 100644 index 0000000..abc8f01 --- /dev/null +++ b/qa/libcmis/data/onedrive/refresh-response.json @@ -0,0 +1,8 @@ +{ + "token_type":"bearer", + "expires_in":3600, + "scope":"wl.signin wl.skydrive", + "access_token":"new-access-token", + "refresh_token":"mock-refresh-token", + "user_id":"mock-user-id" +} diff --git a/qa/libcmis/data/onedrive/search-result.json b/qa/libcmis/data/onedrive/search-result.json new file mode 100644 index 0000000..2482429 --- /dev/null +++ b/qa/libcmis/data/onedrive/search-result.json @@ -0,0 +1,52 @@ +{ + "data":[ + { + "id":"wrongFileId", + "from":{ + "name":"aOneDriveUser", + "id":"1b4a1bc1bdb25a14" + }, + "name":"OneDriveFile", + "description":"", + "parent_id":"folderA", + "size":18047, + "upload_location":"https://apis.live.net/v5.0/wrongFileId/content/", + "comments_count":0, + "comments_enabled":false, + "is_embeddable":true, + "source":"sourceUrl", + "link":"link", + "type":"file", + "shared_with":{ + "access":"Just me" + }, + "created_time":"2014-07-17T15:16:43+0000", + "updated_time":"2014-07-17T15:41:45+0000", + "client_updated_time":"2014-07-17T15:41:45+0000" + }, + { + "id":"rightFile", + "from":{ + "name":"aOneDriveUser", + "id":"1b4a1bc1bdb25a14" + }, + "name":"OneDriveFile", + "description":"", + "parent_id":"folderC", + "size":4, + "upload_location":"https://apis.live.net/v5.0/rightFileId/content/", + "comments_count":0, + "comments_enabled":false, + "is_embeddable":true, + "source":"sourceUrl", + "link":"link", + "type":"file", + "shared_with":{ + "access":"Just me" + }, + "created_time":"2014-06-17T11:30:14+0000", + "updated_time":"2014-06-17T11:30:14+0000", + "client_updated_time":"2014-06-17T11:30:14+0000" + } + ] +} diff --git a/qa/libcmis/data/onedrive/searched-file.json b/qa/libcmis/data/onedrive/searched-file.json new file mode 100644 index 0000000..9a3785c --- /dev/null +++ b/qa/libcmis/data/onedrive/searched-file.json @@ -0,0 +1,24 @@ +{ + "id": "rightFile", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDriveFile", + "description": "short description", + "parent_id": "folderC", + "size": 42, + "upload_location": "https://base/url/aFileId/content", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "source": "sourceUrl", + "link": "linkUrl", + "type": "file", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/searched-wrong-file.json b/qa/libcmis/data/onedrive/searched-wrong-file.json new file mode 100644 index 0000000..4ce9d14 --- /dev/null +++ b/qa/libcmis/data/onedrive/searched-wrong-file.json @@ -0,0 +1,24 @@ +{ + "id": "wrongFile", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "OneDriveFile", + "description": "short description", + "parent_id": "folderA", + "size": 42, + "upload_location": "https://base/url/aFileId/content", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "source": "sourceUrl", + "link": "linkUrl", + "type": "file", + "shared_with": { + "access": "Shared" + }, + "created_time": "2014-06-09T08:24:04+0000", + "updated_time": "2014-06-09T08:24:04+0000", + "client_updated_time": "2014-06-09T08:24:04+0000" +} diff --git a/qa/libcmis/data/onedrive/token-response.json b/qa/libcmis/data/onedrive/token-response.json new file mode 100644 index 0000000..93d8ea6 --- /dev/null +++ b/qa/libcmis/data/onedrive/token-response.json @@ -0,0 +1,8 @@ +{ + "token_type":"bearer", + "expires_in":3600, + "scope":"wl.signin wl.skydrive", + "access_token":"mock-access-token", + "refresh_token":"mock-refresh-token", + "user_id":"mock-user-id" +} diff --git a/qa/libcmis/data/onedrive/updated-file.json b/qa/libcmis/data/onedrive/updated-file.json new file mode 100644 index 0000000..d135ae9 --- /dev/null +++ b/qa/libcmis/data/onedrive/updated-file.json @@ -0,0 +1,24 @@ +{ + "id": "aNewFileId", + "from": { + "name": "onedriveUser", + "id": "aUserId" + }, + "name": "New File Name", + "description": "new description", + "parent_id": "aParentId", + "size": 42, + "upload_location": "uploadLocation", + "comments_count": 0, + "comments_enabled": true, + "is_embeddable": true, + "source": "sourceUrl", + "link": "linkUrl", + "type": "file", + "shared_with": { + "access": "Shared" + }, + "created_time": "createdTime", + "updated_time": "updatedTime", + "client_updated_time": "clientUpdatedTime" +} diff --git a/qa/libcmis/data/sharepoint/auth-resp.json b/qa/libcmis/data/sharepoint/auth-resp.json new file mode 100644 index 0000000..c238467 --- /dev/null +++ b/qa/libcmis/data/sharepoint/auth-resp.json @@ -0,0 +1,191 @@ +{ + "d":{ + "AllProperties":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/AllProperties" + } + }, + "AllowRssFeeds":true, + "AppInstanceId":"00000000-0000-0000-0000-000000000000", + "AssociatedMemberGroup":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/AssociatedMemberGroup" + } + }, + "AssociatedOwnerGroup":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/AssociatedOwnerGroup" + } + }, + "AssociatedVisitorGroup":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/AssociatedVisitorGroup" + } + }, + "AvailableContentTypes":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/AvailableContentTypes" + } + }, + "AvailableFields":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/AvailableFields" + } + }, + "Configuration":0, + "ContentTypes":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/ContentTypes" + } + }, + "Created":"2014-07-02T13:55:23", + "CurrentUser":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/CurrentUser" + } + }, + "CustomMasterUrl":"/_catalogs/masterpage/seattle.master", + "Description":"", + "DocumentLibraryCalloutOfficeWebAppPreviewersDisabled":false, + "EnableMinimalDownload":false, + "EventReceivers":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/EventReceivers" + } + }, + "Features":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/Features" + } + }, + "Fields":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/Fields" + } + }, + "FirstUniqueAncestorSecurableObject":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/FirstUniqueAncestorSecurableObject" + } + }, + "Folders":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/Folders" + } + }, + "Id":"98a58f26-7ed4-436c-917b-05fa37e06ab2", + "Language":1033, + "LastItemModifiedDate":"2014-07-03T10:51:32Z", + "ListTemplates":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/ListTemplates" + } + }, + "Lists":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/Lists" + } + }, + "MasterUrl":"/_catalogs/masterpage/seattle.master", + "Navigation":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/Navigation" + } + }, + "ParentWeb":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/ParentWeb" + } + }, + "PushNotificationSubscribers":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/PushNotificationSubscribers" + } + }, + "QuickLaunchEnabled":true, + "RecycleBin":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/RecycleBin" + } + }, + "RecycleBinEnabled":true, + "RegionalSettings":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/RegionalSettings" + } + }, + "RoleAssignments":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/RoleAssignments" + } + }, + "RoleDefinitions":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/RoleDefinitions" + } + }, + "RootFolder":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/RootFolder" + } + }, + "ServerRelativeUrl":"/", + "SiteGroups":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/SiteGroups" + } + }, + "SiteUserInfoList":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/SiteUserInfoList" + } + }, + "SiteUsers":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/SiteUsers" + } + }, + "SyndicationEnabled":true, + "ThemeInfo":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/ThemeInfo" + } + }, + "Title":"Home", + "TreeViewEnabled":false, + "UIVersion":15, + "UIVersionConfigurationEnabled":false, + "Url":"http://sp-cmis.cloudapp.net", + "UserCustomActions":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/UserCustomActions" + } + }, + "WebInfos":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/WebInfos" + } + }, + "WebTemplate":"STS", + "Webs":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/Webs" + } + }, + "WorkflowAssociations":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/WorkflowAssociations" + } + }, + "WorkflowTemplates":{ + "__deferred":{ + "uri":"http://sp-cmis.cloudapp.net/_api/Web/WorkflowTemplates" + } + }, + "__metadata":{ + "id":"http://sp-cmis.cloudapp.net/_api/Web", + "type":"SP.Web", + "uri":"http://sp-cmis.cloudapp.net/_api/Web" + } + } +}
\ No newline at end of file diff --git a/qa/libcmis/data/sharepoint/auth-xml-resp.xml b/qa/libcmis/data/sharepoint/auth-xml-resp.xml new file mode 100644 index 0000000..1bf3396 --- /dev/null +++ b/qa/libcmis/data/sharepoint/auth-xml-resp.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="http://mock/_api/"> + <id>http://mock/_api/Web</id> + <category term="SP.Web" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> + <link rel="edit" href="Web" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FirstUniqueAncestorSecurableObject" type="application/atom+xml;type=entry" title="FirstUniqueAncestorSecurableObject" href="Web/FirstUniqueAncestorSecurableObject" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleAssignments" type="application/atom+xml;type=feed" title="RoleAssignments" href="Web/RoleAssignments" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AllProperties" type="application/atom+xml;type=entry" title="AllProperties" href="Web/AllProperties" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AssociatedMemberGroup" type="application/atom+xml;type=entry" title="AssociatedMemberGroup" href="Web/AssociatedMemberGroup" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AssociatedOwnerGroup" type="application/atom+xml;type=entry" title="AssociatedOwnerGroup" href="Web/AssociatedOwnerGroup" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AssociatedVisitorGroup" type="application/atom+xml;type=entry" title="AssociatedVisitorGroup" href="Web/AssociatedVisitorGroup" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AvailableContentTypes" type="application/atom+xml;type=feed" title="AvailableContentTypes" href="Web/AvailableContentTypes" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/AvailableFields" type="application/atom+xml;type=feed" title="AvailableFields" href="Web/AvailableFields" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ContentTypes" type="application/atom+xml;type=feed" title="ContentTypes" href="Web/ContentTypes" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CurrentUser" type="application/atom+xml;type=entry" title="CurrentUser" href="Web/CurrentUser" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/EventReceivers" type="application/atom+xml;type=feed" title="EventReceivers" href="Web/EventReceivers" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Features" type="application/atom+xml;type=feed" title="Features" href="Web/Features" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Fields" type="application/atom+xml;type=feed" title="Fields" href="Web/Fields" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Folders" type="application/atom+xml;type=feed" title="Folders" href="Web/Folders" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Lists" type="application/atom+xml;type=feed" title="Lists" href="Web/Lists" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListTemplates" type="application/atom+xml;type=feed" title="ListTemplates" href="Web/ListTemplates" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Navigation" type="application/atom+xml;type=entry" title="Navigation" href="Web/Navigation" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ParentWeb" type="application/atom+xml;type=entry" title="ParentWeb" href="Web/ParentWeb" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PushNotificationSubscribers" type="application/atom+xml;type=feed" title="PushNotificationSubscribers" href="Web/PushNotificationSubscribers" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RecycleBin" type="application/atom+xml;type=feed" title="RecycleBin" href="Web/RecycleBin" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RegionalSettings" type="application/atom+xml;type=entry" title="RegionalSettings" href="Web/RegionalSettings" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RoleDefinitions" type="application/atom+xml;type=feed" title="RoleDefinitions" href="Web/RoleDefinitions" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/RootFolder" type="application/atom+xml;type=entry" title="RootFolder" href="Web/RootFolder" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SiteGroups" type="application/atom+xml;type=feed" title="SiteGroups" href="Web/SiteGroups" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SiteUserInfoList" type="application/atom+xml;type=entry" title="SiteUserInfoList" href="Web/SiteUserInfoList" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SiteUsers" type="application/atom+xml;type=feed" title="SiteUsers" href="Web/SiteUsers" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ThemeInfo" type="application/atom+xml;type=entry" title="ThemeInfo" href="Web/ThemeInfo" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/UserCustomActions" type="application/atom+xml;type=feed" title="UserCustomActions" href="Web/UserCustomActions" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Webs" type="application/atom+xml;type=feed" title="Webs" href="Web/Webs" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/WebInfos" type="application/atom+xml;type=feed" title="WebInfos" href="Web/WebInfos" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/WorkflowAssociations" type="application/atom+xml;type=feed" title="WorkflowAssociations" href="Web/WorkflowAssociations" /> + <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/WorkflowTemplates" type="application/atom+xml;type=feed" title="WorkflowTemplates" href="Web/WorkflowTemplates" /> + <title /> + <updated>2014-07-10T07:24:26Z</updated> + <author> + <name /> + </author> + <content type="application/xml"> + <m:properties> + <d:AllowRssFeeds m:type="Edm.Boolean">true</d:AllowRssFeeds> + <d:AppInstanceId m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:AppInstanceId> + <d:Configuration m:type="Edm.Int16">0</d:Configuration> + <d:Created m:type="Edm.DateTime">2014-07-02T13:55:23</d:Created> + <d:CustomMasterUrl>/_catalogs/masterpage/seattle.master</d:CustomMasterUrl> + <d:Description /> + <d:DocumentLibraryCalloutOfficeWebAppPreviewersDisabled m:type="Edm.Boolean">false</d:DocumentLibraryCalloutOfficeWebAppPreviewersDisabled> + <d:EnableMinimalDownload m:type="Edm.Boolean">false</d:EnableMinimalDownload> + <d:Id m:type="Edm.Guid">98a58f26-7ed4-436c-917b-05fa37e06ab2</d:Id> + <d:Language m:type="Edm.Int32">1033</d:Language> + <d:LastItemModifiedDate m:type="Edm.DateTime">2014-07-08T09:29:30Z</d:LastItemModifiedDate> + <d:MasterUrl>/_catalogs/masterpage/seattle.master</d:MasterUrl> + <d:QuickLaunchEnabled m:type="Edm.Boolean">true</d:QuickLaunchEnabled> + <d:RecycleBinEnabled m:type="Edm.Boolean">true</d:RecycleBinEnabled> + <d:ServerRelativeUrl>/</d:ServerRelativeUrl> + <d:SyndicationEnabled m:type="Edm.Boolean">true</d:SyndicationEnabled> + <d:Title>Home</d:Title> + <d:TreeViewEnabled m:type="Edm.Boolean">false</d:TreeViewEnabled> + <d:UIVersion m:type="Edm.Int32">15</d:UIVersion> + <d:UIVersionConfigurationEnabled m:type="Edm.Boolean">false</d:UIVersionConfigurationEnabled> + <d:Url>http://mock</d:Url> + <d:WebTemplate>STS</d:WebTemplate> + </m:properties> + </content> +</entry> diff --git a/qa/libcmis/data/sharepoint/author.json b/qa/libcmis/data/sharepoint/author.json new file mode 100644 index 0000000..91eb0fb --- /dev/null +++ b/qa/libcmis/data/sharepoint/author.json @@ -0,0 +1,28 @@ +{ + "d":{ + "Email":"", + "Groups":{ + "__deferred":{ + "uri":"http://mock/_api/Web/GetUserById(1)/Groups" + } + }, + "Id":1, + "IsHiddenInUI":false, + "IsSiteAdmin":true, + "LoginName":"i:0#.w|sp-cmis\\aUserId", + "PrincipalType":1, + "Title":"aUserId", + "UserId":{ + "NameId":"s-1-5-21-1673017749-4204619129-3521412262-500", + "NameIdIssuer":"urn:office:idp:activedirectory", + "__metadata":{ + "type":"SP.UserIdInfo" + } + }, + "__metadata":{ + "id":"http://mock/_api/Web/GetUserById(1)", + "type":"SP.User", + "uri":"http://mock/_api/Web/GetUserById(1)" + } + } +} diff --git a/qa/libcmis/data/sharepoint/children-files.json b/qa/libcmis/data/sharepoint/children-files.json new file mode 100644 index 0000000..b09d46e --- /dev/null +++ b/qa/libcmis/data/sharepoint/children-files.json @@ -0,0 +1,60 @@ +{ + "d":{ + "results":[ + { + "Author":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/Author" + } + }, + "CheckInComment":"aCheckinComment", + "CheckOutType":2, + "CheckedOutByUser":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/CheckedOutByUser" + } + }, + "ContentTag":"{AD7FC895-3E19-4553-AD77-9ADFC2A3B69A},1,2", + "CustomizedPageStatus":0, + "ETag":"\"{AD7FC895-3E19-4553-AD77-9ADFC2A3B69A},1\"", + "Exists":true, + "Length":"18045", + "Level":1, + "ListItemAllFields":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/ListItemAllFields" + } + }, + "LockedByUser":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/LockedByUser" + } + }, + "MajorVersion":2, + "MinorVersion":0, + "ModifiedBy":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/ModifiedBy" + } + }, + "Name":"SharePoint File", + "ServerRelative_api/Web":"/Shared Documents/file.txt", + "TimeCreated":"2014-07-08T09:29:29Z", + "TimeLastModified":"2014-07-08T09:29:29Z", + "Title":"", + "UIVersion":512, + "UIVersionLabel":"1.0", + "Versions":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/Versions" + } + }, + "__metadata":{ + "id":"http://base/_api/Web/aFileId", + "type":"SP.File", + "uri":"http://base/_api/Web/aFileId" + } + } + ] + } +} diff --git a/qa/libcmis/data/sharepoint/children-folders.json b/qa/libcmis/data/sharepoint/children-folders.json new file mode 100644 index 0000000..25e4cb2 --- /dev/null +++ b/qa/libcmis/data/sharepoint/children-folders.json @@ -0,0 +1,42 @@ +{ + "d": { + "results":[ + { + "Files": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/Files" + } + }, + "Folders": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/Folders" + } + }, + "ItemCount": 3, + "ListItemAllFields": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/ListItemAllFields" + } + }, + "Name": "SharePoint Folder", + "ParentFolder": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/ParentFolder" + } + }, + "Properties": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/Properties" + } + }, + "ServerRelativeUrl": "/Shared Documents", + "WelcomePage": "", + "__metadata": { + "id": "http://base/_api/Web/aFolderId", + "type": "SP.Folder", + "uri": "http://base/_api/Web/aFolderId" + } + } + ] + } +} diff --git a/qa/libcmis/data/sharepoint/file-v1.json b/qa/libcmis/data/sharepoint/file-v1.json new file mode 100644 index 0000000..a40382e --- /dev/null +++ b/qa/libcmis/data/sharepoint/file-v1.json @@ -0,0 +1,56 @@ +{ + "d":{ + "Author":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/Author" + } + }, + "CheckInComment":"aCheckinComment", + "CheckOutType":2, + "CheckedOutByUser":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/CheckedOutByUser" + } + }, + "ContentTag":"{AD7FC895-3E19-4553-AD77-9ADFC2A3B69A},1,2", + "CustomizedPageStatus":0, + "ETag":"\"{AD7FC895-3E19-4553-AD77-9ADFC2A3B69A},1\"", + "Exists":true, + "Length":"18045", + "Level":1, + "ListItemAllFields":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/ListItemAllFields" + } + }, + "LockedByUser":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/LockedByUser" + } + }, + "MajorVersion":2, + "MinorVersion":0, + "ModifiedBy":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/ModifiedBy" + } + }, + "Name":"SharePointFile", + "ServerRelativeUrl":"/Shared Documents/file.txt", + "TimeCreated":"2014-07-08T09:29:29Z", + "TimeLastModified":"2014-07-08T09:29:29Z", + "Title":"", + "UIVersion":512, + "UIVersionLabel":"1.0", + "Versions":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/Versions" + } + }, + "__metadata":{ + "id":"http://base/_api/Web/aFileId-v1", + "type":"SP.File", + "uri":"http://base/_api/Web/aFileId-v1" + } + } +} diff --git a/qa/libcmis/data/sharepoint/file.json b/qa/libcmis/data/sharepoint/file.json new file mode 100644 index 0000000..16d92a7 --- /dev/null +++ b/qa/libcmis/data/sharepoint/file.json @@ -0,0 +1,56 @@ +{ + "d":{ + "Author":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/Author" + } + }, + "CheckInComment":"aCheckinComment", + "CheckOutType":2, + "CheckedOutByUser":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/CheckedOutByUser" + } + }, + "ContentTag":"{AD7FC895-3E19-4553-AD77-9ADFC2A3B69A},1,2", + "CustomizedPageStatus":0, + "ETag":"\"{AD7FC895-3E19-4553-AD77-9ADFC2A3B69A},1\"", + "Exists":true, + "Length":"18045", + "Level":1, + "ListItemAllFields":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/ListItemAllFields" + } + }, + "LockedByUser":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/LockedByUser" + } + }, + "MajorVersion":2, + "MinorVersion":0, + "ModifiedBy":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/ModifiedBy" + } + }, + "Name":"SharePointFile", + "ServerRelativeUrl":"/Shared Documents/file.txt", + "TimeCreated":"2014-07-08T09:29:29Z", + "TimeLastModified":"2014-07-08T09:29:29Z", + "Title":"", + "UIVersion":512, + "UIVersionLabel":"1.0", + "Versions":{ + "__deferred":{ + "uri":"http://base/_api/Web/aFileId/Versions" + } + }, + "__metadata":{ + "id":"http://base/_api/Web/aFileId", + "type":"SP.File", + "uri":"http://base/_api/Web/aFileId" + } + } +} diff --git a/qa/libcmis/data/sharepoint/folder-properties.json b/qa/libcmis/data/sharepoint/folder-properties.json new file mode 100644 index 0000000..44147a9 --- /dev/null +++ b/qa/libcmis/data/sharepoint/folder-properties.json @@ -0,0 +1,35 @@ +{ + "d": { + "__metadata": { + "id": "http://base/_api/web/aFolderId/properties", + "type": "SP.PropertyValues", + "uri": "http://base/_api/web/aFolderId/properties" + }, + "vti_x005f_candeleteversion": "true", + "vti_x005f_dirlateststamp": "2014-07-28T16:10:28", + "vti_x005f_docstoretype": 1, + "vti_x005f_etag": "\"{61A348A0-D6D6-4B67-91E9-FFC87CCDE1BF},0\"", + "vti_x005f_folderitemcount": 3, + "vti_x005f_foldersubfolderitemcount": 0, + "vti_x005f_hassubdirs": "true", + "vti_x005f_isbrowsable": "true", + "vti_x005f_isexecutable": "false", + "vti_x005f_isscriptable": "false", + "vti_x005f_level": 1, + "vti_x005f_listbasetype": 1, + "vti_x005f_listenableminorversions": "true", + "vti_x005f_listenablemoderation": "false", + "vti_x005f_listenableversioning": "true", + "vti_x005f_listname": "{D0014F89-052C-4F0A-A65D-A61DFC837093}", + "vti_x005f_listrequirecheckout": "false", + "vti_x005f_listservertemplate": 101, + "vti_x005f_listtitle": "Documents", + "vti_x005f_metainfoversion": 1, + "vti_x005f_nexttolasttimemodified": "2014-07-08T09:29:29", + "vti_x005f_parentid": "{F3A8C5D9-525D-4BEB-A9DF-4CA122A5D074}", + "vti_x005f_replid": "rid:{61A348A0-D6D6-4B67-91E9-FFC87CCDE1BF}", + "vti_x005f_rtag": "rt:61A348A0-D6D6-4B67-91E9-FFC87CCDE1BF@00000000000", + "vti_x005f_timecreated": "2014-07-02T14:19:02", + "vti_x005f_timelastmodified": "2014-07-14T09:15:56" + } +} diff --git a/qa/libcmis/data/sharepoint/folder.json b/qa/libcmis/data/sharepoint/folder.json new file mode 100644 index 0000000..da658eb --- /dev/null +++ b/qa/libcmis/data/sharepoint/folder.json @@ -0,0 +1,38 @@ +{ + "d": { + "Files": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/Files" + } + }, + "Folders": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/Folders" + } + }, + "ItemCount": 3, + "ListItemAllFields": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/ListItemAllFields" + } + }, + "Name": "SharePointFolder", + "ParentFolder": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/ParentFolder" + } + }, + "Properties": { + "__deferred": { + "uri": "http://base/_api/Web/aFolderId/Properties" + } + }, + "ServerRelativeUrl": "/SharePointFolder", + "WelcomePage": "", + "__metadata": { + "id": "http://base/_api/Web/aFolderId", + "type": "SP.Folder", + "uri": "http://base/_api/Web/aFolderId" + } + } +} diff --git a/qa/libcmis/data/sharepoint/new-xdigest.json b/qa/libcmis/data/sharepoint/new-xdigest.json new file mode 100644 index 0000000..7d92f57 --- /dev/null +++ b/qa/libcmis/data/sharepoint/new-xdigest.json @@ -0,0 +1,20 @@ +{ + "d":{ + "GetContextWebInformation":{ + "FormDigestTimeoutSeconds":1800, + "FormDigestValue":"new-xdigest-code", + "LibraryVersion":"15.0.4420.1017", + "SiteFullUrl":"http://base/_api", + "SupportedSchemaVersions":{ + "results":[ + "14.0.0.0", + "15.0.0.0" + ] + }, + "WebFullUrl":"http://base/_api", + "__metadata":{ + "type":"SP.ContextWebInformation" + } + } + } +} diff --git a/qa/libcmis/data/sharepoint/root-folder.json b/qa/libcmis/data/sharepoint/root-folder.json new file mode 100644 index 0000000..7e60969 --- /dev/null +++ b/qa/libcmis/data/sharepoint/root-folder.json @@ -0,0 +1,38 @@ +{ + "d":{ + "Files":{ + "__deferred":{ + "uri":"http://base/_api/Web/rootFolderId/Files" + } + }, + "Folders":{ + "__deferred":{ + "uri":"http://base/_api/Web/rootFolderId/Folders" + } + }, + "ItemCount":0, + "ListItemAllFields":{ + "__deferred":{ + "uri":"http://base/_api/Web/rootFolderId/ListItemAllFields" + } + }, + "Name":"", + "ParentFolder":{ + "__deferred":{ + "uri":"http://base/_api/Web/rootFolderId/ParentFolder" + } + }, + "Properties":{ + "__deferred":{ + "uri":"http://base/_api/Web/rootFolderId/Properties" + } + }, + "ServerRelativeUrl":"/", + "WelcomePage":"SitePages/Home.aspx", + "__metadata":{ + "id":"http://base/_api/Web/rootFolderId", + "type":"SP.Folder", + "uri":"http://base/_api/Web/rootFolderId" + } + } +} diff --git a/qa/libcmis/data/sharepoint/versions.json b/qa/libcmis/data/sharepoint/versions.json new file mode 100644 index 0000000..83b7f5a --- /dev/null +++ b/qa/libcmis/data/sharepoint/versions.json @@ -0,0 +1,44 @@ +{ + "d": { + "results": [ + { + "CheckInComment": "checkin Comment", + "Created": "2014-07-25T12:07:57Z", + "CreatedBy": { + "__deferred": { + "uri": "http://sp-cmis.cloudapp.net/_api/SP.FileVersionc617ba22-0ea6-4d05-a9ac-6135d8cede1a/CreatedBy" + } + }, + "ID": 1, + "IsCurrentVersion": true, + "Size": 14027, + "Url": "_vti_history/512/Shared Documents/File Name", + "VersionLabel": "1.0", + "__metadata": { + "id": "http://sp-cmis.cloudapp.net/_api/SP.FileVersionc617ba22-0ea6-4d05-a9ac-6135d8cede1a", + "type": "SP.FileVersion", + "uri": "http://sp-cmis.cloudapp.net/_api/SP.FileVersionc617ba22-0ea6-4d05-a9ac-6135d8cede1a" + } + }, + { + "CheckInComment": "checkin Comment", + "Created": "2014-07-25T12:13:47Z", + "CreatedBy": { + "__deferred": { + "uri": "http://sp-cmis.cloudapp.net/_api/SP.FileVersion5e4560d1-2047-4d3d-9f14-5be91aaf1f6c/CreatedBy" + } + }, + "ID": 2, + "IsCurrentVersion": false, + "Size": 14120, + "Url": "_vti_history/513/Shared Documents/File Name", + "VersionLabel": "1.1", + "__metadata": { + "id": "http://sp-cmis.cloudapp.net/_api/SP.FileVersion5e4560d1-2047-4d3d-9f14-5be91aaf1f6c", + "type": "SP.FileVersion", + "uri": "http://sp-cmis.cloudapp.net/_api/SP.FileVersion5e4560d1-2047-4d3d-9f14-5be91aaf1f6c" + } + } + ] + } +} diff --git a/qa/libcmis/data/sharepoint/xdigest.json b/qa/libcmis/data/sharepoint/xdigest.json new file mode 100644 index 0000000..661502f --- /dev/null +++ b/qa/libcmis/data/sharepoint/xdigest.json @@ -0,0 +1,20 @@ +{ + "d":{ + "GetContextWebInformation":{ + "FormDigestTimeoutSeconds":1800, + "FormDigestValue":"0xEBC52E4F66DE48475242A8F8291E9C6CAE1C71525B2EFFC8100F87746F4A5780E5EFCA2ABF063C8B3B08B987EBF56BF7ADE4A94714934D2C3928E060FBA4009A,14 Jul 2014 08:31:38 -0000", + "LibraryVersion":"15.0.4420.1017", + "SiteFullUrl":"http://base/_api", + "SupportedSchemaVersions":{ + "results":[ + "14.0.0.0", + "15.0.0.0" + ] + }, + "WebFullUrl":"http://base/_api", + "__metadata":{ + "type":"SP.ContextWebInformation" + } + } + } +} diff --git a/qa/libcmis/data/ws/CMISWS-Service.wsdl b/qa/libcmis/data/ws/CMISWS-Service.wsdl new file mode 100644 index 0000000..5c998a6 --- /dev/null +++ b/qa/libcmis/data/ws/CMISWS-Service.wsdl @@ -0,0 +1,1262 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Content Management Interoperability Services (CMIS) Version 1.1 + Committee Specification 01 + 12 November 2012 + Copyright (c) OASIS Open 2012. All Rights Reserved. + Source: http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/schema/ + --> +<!-- + CMIS 1.1 WSDL + --> +<definitions xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:cmisw="http://docs.oasis-open.org/ns/cmis/ws/200908/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://schemas.xmlsoap.org/soap/encoding/" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" targetNamespace="http://docs.oasis-open.org/ns/cmis/ws/200908/" name="CMISWebServices"> + <types> + <xsd:schema elementFormDefault="qualified" targetNamespace="http://docs.oasis-open.org/ns/cmis/ws/200908/"> + <xsd:import schemaLocation="CMIS-Core.xsd" namespace="http://docs.oasis-open.org/ns/cmis/core/200908/"/> + <xsd:import schemaLocation="CMIS-Messaging.xsd" namespace="http://docs.oasis-open.org/ns/cmis/messaging/200908/"/> + </xsd:schema> + </types> + <message name="cmisException"> + <part name="fault" element="cmism:cmisFault"/> + </message> + <message name="getACLRequest"> + <part name="parameters" element="cmism:getACL"/> + </message> + <message name="getACLResponse"> + <part name="parameters" element="cmism:getACLResponse"/> + </message> + <message name="applyACLRequest"> + <part name="parameters" element="cmism:applyACL"/> + </message> + <message name="applyACLResponse"> + <part name="parameters" element="cmism:applyACLResponse"/> + </message> + <message name="queryRequest"> + <part name="parameters" element="cmism:query"/> + </message> + <message name="queryResponse"> + <part name="parameters" element="cmism:queryResponse"/> + </message> + <message name="getContentChangesRequest"> + <part name="parameters" element="cmism:getContentChanges"/> + </message> + <message name="getContentChangesResponse"> + <part name="parameters" element="cmism:getContentChangesResponse"/> + </message> + <message name="addObjectToFolderRequest"> + <part name="parameters" element="cmism:addObjectToFolder"/> + </message> + <message name="addObjectToFolderResponse"> + <part name="parameters" element="cmism:addObjectToFolderResponse"/> + </message> + <message name="removeObjectFromFolderRequest"> + <part name="parameters" element="cmism:removeObjectFromFolder"/> + </message> + <message name="removeObjectFromFolderResponse"> + <part name="parameters" element="cmism:removeObjectFromFolderResponse"/> + </message> + <message name="getDescendantsRequest"> + <part name="parameters" element="cmism:getDescendants"/> + </message> + <message name="getDescendantsResponse"> + <part name="parameters" element="cmism:getDescendantsResponse"/> + </message> + <message name="getChildrenRequest"> + <part name="parameters" element="cmism:getChildren"/> + </message> + <message name="getChildrenResponse"> + <part name="parameters" element="cmism:getChildrenResponse"/> + </message> + <message name="getFolderParentRequest"> + <part name="parameters" element="cmism:getFolderParent"/> + </message> + <message name="getFolderParentResponse"> + <part name="parameters" element="cmism:getFolderParentResponse"/> + </message> + <message name="getObjectParentsRequest"> + <part name="parameters" element="cmism:getObjectParents"/> + </message> + <message name="getObjectParentsResponse"> + <part name="parameters" element="cmism:getObjectParentsResponse"/> + </message> + <message name="getRenditionsRequest"> + <part name="parameters" element="cmism:getRenditions"/> + </message> + <message name="getRenditionsResponse"> + <part name="parameters" element="cmism:getRenditionsResponse"/> + </message> + <message name="getCheckedOutDocsRequest"> + <part name="parameters" element="cmism:getCheckedOutDocs"/> + </message> + <message name="getCheckedOutDocsResponse"> + <part name="parameters" element="cmism:getCheckedOutDocsResponse"/> + </message> + <message name="createDocumentRequest"> + <part name="parameters" element="cmism:createDocument"/> + </message> + <message name="createDocumentResponse"> + <part name="parameters" element="cmism:createDocumentResponse"/> + </message> + <message name="createDocumentFromSourceRequest"> + <part name="parameters" element="cmism:createDocumentFromSource"/> + </message> + <message name="createDocumentFromSourceResponse"> + <part name="parameters" element="cmism:createDocumentFromSourceResponse"/> + </message> + <message name="createFolderRequest"> + <part name="parameters" element="cmism:createFolder"/> + </message> + <message name="createFolderResponse"> + <part name="parameters" element="cmism:createFolderResponse"/> + </message> + <message name="createRelationshipRequest"> + <part name="parameters" element="cmism:createRelationship"/> + </message> + <message name="createRelationshipResponse"> + <part name="parameters" element="cmism:createRelationshipResponse"/> + </message> + <message name="createPolicyRequest"> + <part name="parameters" element="cmism:createPolicy"/> + </message> + <message name="createPolicyResponse"> + <part name="parameters" element="cmism:createPolicyResponse"/> + </message> + <message name="createItemRequest"> + <part name="parameters" element="cmism:createItem"/> + </message> + <message name="createItemResponse"> + <part name="parameters" element="cmism:createItemResponse"/> + </message> + <message name="getAllowableActionsRequest"> + <part name="parameters" element="cmism:getAllowableActions"/> + </message> + <message name="getAllowableActionsResponse"> + <part name="parameters" element="cmism:getAllowableActionsResponse"/> + </message> + <message name="getObjectRequest"> + <part name="parameters" element="cmism:getObject"/> + </message> + <message name="getObjectResponse"> + <part name="parameters" element="cmism:getObjectResponse"/> + </message> + <message name="getPropertiesRequest"> + <part name="parameters" element="cmism:getProperties"/> + </message> + <message name="getPropertiesResponse"> + <part name="parameters" element="cmism:getPropertiesResponse"/> + </message> + <message name="getObjectByPathRequest"> + <part name="parameters" element="cmism:getObjectByPath"/> + </message> + <message name="getObjectByPathResponse"> + <part name="parameters" element="cmism:getObjectByPathResponse"/> + </message> + <message name="getContentStreamRequest"> + <part name="parameters" element="cmism:getContentStream"/> + </message> + <message name="getContentStreamResponse"> + <part name="parameters" element="cmism:getContentStreamResponse"/> + </message> + <message name="updatePropertiesRequest"> + <part name="parameters" element="cmism:updateProperties"/> + </message> + <message name="updatePropertiesResponse"> + <part name="parameters" element="cmism:updatePropertiesResponse"/> + </message> + <message name="bulkUpdatePropertiesRequest"> + <part name="parameters" element="cmism:bulkUpdateProperties"/> + </message> + <message name="bulkUpdatePropertiesResponse"> + <part name="parameters" element="cmism:bulkUpdatePropertiesResponse"/> + </message> + <message name="moveObjectRequest"> + <part name="parameters" element="cmism:moveObject"/> + </message> + <message name="moveObjectResponse"> + <part name="parameters" element="cmism:moveObjectResponse"/> + </message> + <message name="deleteObjectRequest"> + <part name="parameters" element="cmism:deleteObject"/> + </message> + <message name="deleteObjectResponse"> + <part name="parameters" element="cmism:deleteObjectResponse"/> + </message> + <message name="deleteTreeRequest"> + <part name="parameters" element="cmism:deleteTree"/> + </message> + <message name="deleteTreeResponse"> + <part name="parameters" element="cmism:deleteTreeResponse"/> + </message> + <message name="setContentStreamRequest"> + <part name="parameters" element="cmism:setContentStream"/> + </message> + <message name="setContentStreamResponse"> + <part name="parameters" element="cmism:setContentStreamResponse"/> + </message> + <message name="appendContentStreamRequest"> + <part name="parameters" element="cmism:appendContentStream"/> + </message> + <message name="appendContentStreamResponse"> + <part name="parameters" element="cmism:appendContentStreamResponse"/> + </message> + <message name="deleteContentStreamRequest"> + <part name="parameters" element="cmism:deleteContentStream"/> + </message> + <message name="deleteContentStreamResponse"> + <part name="parameters" element="cmism:deleteContentStreamResponse"/> + </message> + <message name="applyPolicyRequest"> + <part name="parameters" element="cmism:applyPolicy"/> + </message> + <message name="applyPolicyResponse"> + <part name="parameters" element="cmism:applyPolicyResponse"/> + </message> + <message name="removePolicyRequest"> + <part name="parameters" element="cmism:removePolicy"/> + </message> + <message name="removePolicyResponse"> + <part name="parameters" element="cmism:removePolicyResponse"/> + </message> + <message name="getAppliedPoliciesRequest"> + <part name="parameters" element="cmism:getAppliedPolicies"/> + </message> + <message name="getAppliedPoliciesResponse"> + <part name="parameters" element="cmism:getAppliedPoliciesResponse"/> + </message> + <message name="getObjectRelationshipsRequest"> + <part name="parameters" element="cmism:getObjectRelationships"/> + </message> + <message name="getObjectRelationshipsResponse"> + <part name="parameters" element="cmism:getObjectRelationshipsResponse"/> + </message> + <message name="getRepositoriesRequest"> + <part name="parameters" element="cmism:getRepositories"/> + </message> + <message name="getRepositoriesResponse"> + <part name="parameters" element="cmism:getRepositoriesResponse"/> + </message> + <message name="getRepositoryInfoRequest"> + <part name="parameters" element="cmism:getRepositoryInfo"/> + </message> + <message name="getRepositoryInfoResponse"> + <part name="parameters" element="cmism:getRepositoryInfoResponse"/> + </message> + <message name="getTypeChildrenRequest"> + <part name="parameters" element="cmism:getTypeChildren"/> + </message> + <message name="getTypeChildrenResponse"> + <part name="parameters" element="cmism:getTypeChildrenResponse"/> + </message> + <message name="getTypeDescendantsRequest"> + <part name="parameters" element="cmism:getTypeDescendants"/> + </message> + <message name="getTypeDescendantsResponse"> + <part name="parameters" element="cmism:getTypeDescendantsResponse"/> + </message> + <message name="getTypeDefinitionRequest"> + <part name="parameters" element="cmism:getTypeDefinition"/> + </message> + <message name="getTypeDefinitionResponse"> + <part name="parameters" element="cmism:getTypeDefinitionResponse"/> + </message> + <message name="createTypeRequest"> + <part name="parameters" element="cmism:createType"/> + </message> + <message name="createTypeResponse"> + <part name="parameters" element="cmism:createTypeResponse"/> + </message> + <message name="updateTypeRequest"> + <part name="parameters" element="cmism:updateType"/> + </message> + <message name="updateTypeResponse"> + <part name="parameters" element="cmism:updateTypeResponse"/> + </message> + <message name="deleteTypeRequest"> + <part name="parameters" element="cmism:deleteType"/> + </message> + <message name="deleteTypeResponse"> + <part name="parameters" element="cmism:deleteTypeResponse"/> + </message> + <message name="checkOutRequest"> + <part name="parameters" element="cmism:checkOut"/> + </message> + <message name="checkOutResponse"> + <part name="parameters" element="cmism:checkOutResponse"/> + </message> + <message name="cancelCheckOutRequest"> + <part name="parameters" element="cmism:cancelCheckOut"/> + </message> + <message name="cancelCheckOutResponse"> + <part name="parameters" element="cmism:cancelCheckOutResponse"/> + </message> + <message name="checkInRequest"> + <part name="parameters" element="cmism:checkIn"/> + </message> + <message name="checkInResponse"> + <part name="parameters" element="cmism:checkInResponse"/> + </message> + <message name="getObjectOfLatestVersionRequest"> + <part name="parameters" element="cmism:getObjectOfLatestVersion"/> + </message> + <message name="getObjectOfLatestVersionResponse"> + <part name="parameters" element="cmism:getObjectOfLatestVersionResponse"/> + </message> + <message name="getPropertiesOfLatestVersionRequest"> + <part name="parameters" element="cmism:getPropertiesOfLatestVersion"/> + </message> + <message name="getPropertiesOfLatestVersionResponse"> + <part name="parameters" element="cmism:getPropertiesOfLatestVersionResponse"/> + </message> + <message name="getAllVersionsRequest"> + <part name="parameters" element="cmism:getAllVersions"/> + </message> + <message name="getAllVersionsResponse"> + <part name="parameters" element="cmism:getAllVersionsResponse"/> + </message> + <message name="getFolderTreeRequest"> + <part name="parameters" element="cmism:getFolderTree"/> + </message> + <message name="getFolderTreeResponse"> + <part name="parameters" element="cmism:getFolderTreeResponse"/> + </message> + <portType name="DiscoveryServicePort"> + <operation name="query"> + <input message="cmisw:queryRequest"/> + <output message="cmisw:queryResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getContentChanges"> + <input message="cmisw:getContentChangesRequest"/> + <output message="cmisw:getContentChangesResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="MultiFilingServicePort"> + <operation name="addObjectToFolder"> + <input message="cmisw:addObjectToFolderRequest"/> + <output message="cmisw:addObjectToFolderResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="removeObjectFromFolder"> + <input message="cmisw:removeObjectFromFolderRequest"/> + <output message="cmisw:removeObjectFromFolderResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="NavigationServicePort"> + <operation name="getDescendants"> + <input message="cmisw:getDescendantsRequest"/> + <output message="cmisw:getDescendantsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getChildren"> + <input message="cmisw:getChildrenRequest"/> + <output message="cmisw:getChildrenResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getFolderParent"> + <input message="cmisw:getFolderParentRequest"/> + <output message="cmisw:getFolderParentResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getFolderTree"> + <input message="cmisw:getFolderTreeRequest"/> + <output message="cmisw:getFolderTreeResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getObjectParents"> + <input message="cmisw:getObjectParentsRequest"/> + <output message="cmisw:getObjectParentsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getCheckedOutDocs"> + <input message="cmisw:getCheckedOutDocsRequest"/> + <output message="cmisw:getCheckedOutDocsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="ObjectServicePort"> + <operation name="createDocument"> + <input message="cmisw:createDocumentRequest"/> + <output message="cmisw:createDocumentResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="createDocumentFromSource"> + <input message="cmisw:createDocumentFromSourceRequest"/> + <output message="cmisw:createDocumentFromSourceResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="createFolder"> + <input message="cmisw:createFolderRequest"/> + <output message="cmisw:createFolderResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="createRelationship"> + <input message="cmisw:createRelationshipRequest"/> + <output message="cmisw:createRelationshipResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="createPolicy"> + <input message="cmisw:createPolicyRequest"/> + <output message="cmisw:createPolicyResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="createItem"> + <input message="cmisw:createItemRequest"/> + <output message="cmisw:createItemResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getAllowableActions"> + <input message="cmisw:getAllowableActionsRequest"/> + <output message="cmisw:getAllowableActionsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getObject"> + <input message="cmisw:getObjectRequest"/> + <output message="cmisw:getObjectResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getProperties"> + <input message="cmisw:getPropertiesRequest"/> + <output message="cmisw:getPropertiesResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getRenditions"> + <input message="cmisw:getRenditionsRequest"/> + <output message="cmisw:getRenditionsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getObjectByPath"> + <input message="cmisw:getObjectByPathRequest"/> + <output message="cmisw:getObjectByPathResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getContentStream"> + <input message="cmisw:getContentStreamRequest"/> + <output message="cmisw:getContentStreamResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="updateProperties"> + <input message="cmisw:updatePropertiesRequest"/> + <output message="cmisw:updatePropertiesResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="bulkUpdateProperties"> + <input message="cmisw:bulkUpdatePropertiesRequest"/> + <output message="cmisw:bulkUpdatePropertiesResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="moveObject"> + <input message="cmisw:moveObjectRequest"/> + <output message="cmisw:moveObjectResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="deleteObject"> + <input message="cmisw:deleteObjectRequest"/> + <output message="cmisw:deleteObjectResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="deleteTree"> + <input message="cmisw:deleteTreeRequest"/> + <output message="cmisw:deleteTreeResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="setContentStream"> + <input message="cmisw:setContentStreamRequest"/> + <output message="cmisw:setContentStreamResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="appendContentStream"> + <input message="cmisw:appendContentStreamRequest"/> + <output message="cmisw:appendContentStreamResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="deleteContentStream"> + <input message="cmisw:deleteContentStreamRequest"/> + <output message="cmisw:deleteContentStreamResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="PolicyServicePort"> + <operation name="applyPolicy"> + <input message="cmisw:applyPolicyRequest"/> + <output message="cmisw:applyPolicyResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="removePolicy"> + <input message="cmisw:removePolicyRequest"/> + <output message="cmisw:removePolicyResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getAppliedPolicies"> + <input message="cmisw:getAppliedPoliciesRequest"/> + <output message="cmisw:getAppliedPoliciesResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="RelationshipServicePort"> + <operation name="getObjectRelationships"> + <input message="cmisw:getObjectRelationshipsRequest"/> + <output message="cmisw:getObjectRelationshipsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="RepositoryServicePort"> + <operation name="getRepositories"> + <input message="cmisw:getRepositoriesRequest"/> + <output message="cmisw:getRepositoriesResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getRepositoryInfo"> + <input message="cmisw:getRepositoryInfoRequest"/> + <output message="cmisw:getRepositoryInfoResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getTypeChildren"> + <input message="cmisw:getTypeChildrenRequest"/> + <output message="cmisw:getTypeChildrenResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getTypeDescendants"> + <input message="cmisw:getTypeDescendantsRequest"/> + <output message="cmisw:getTypeDescendantsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getTypeDefinition"> + <input message="cmisw:getTypeDefinitionRequest"/> + <output message="cmisw:getTypeDefinitionResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="createType"> + <input message="cmisw:createTypeRequest"/> + <output message="cmisw:createTypeResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="updateType"> + <input message="cmisw:updateTypeRequest"/> + <output message="cmisw:updateTypeResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="deleteType"> + <input message="cmisw:deleteTypeRequest"/> + <output message="cmisw:deleteTypeResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="VersioningServicePort"> + <operation name="checkOut"> + <input message="cmisw:checkOutRequest"/> + <output message="cmisw:checkOutResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="cancelCheckOut"> + <input message="cmisw:cancelCheckOutRequest"/> + <output message="cmisw:cancelCheckOutResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="checkIn"> + <input message="cmisw:checkInRequest"/> + <output message="cmisw:checkInResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getObjectOfLatestVersion"> + <input message="cmisw:getObjectOfLatestVersionRequest"/> + <output message="cmisw:getObjectOfLatestVersionResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getPropertiesOfLatestVersion"> + <input message="cmisw:getPropertiesOfLatestVersionRequest"/> + <output message="cmisw:getPropertiesOfLatestVersionResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="getAllVersions"> + <input message="cmisw:getAllVersionsRequest"/> + <output message="cmisw:getAllVersionsResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <portType name="ACLServicePort"> + <operation name="getACL"> + <input message="cmisw:getACLRequest"/> + <output message="cmisw:getACLResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + <operation name="applyACL"> + <input message="cmisw:applyACLRequest"/> + <output message="cmisw:applyACLResponse"/> + <fault message="cmisw:cmisException" name="cmisException"/> + </operation> + </portType> + <binding name="DiscoveryServicePortBinding" type="cmisw:DiscoveryServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="query"> + <soap:operation soapAction="query"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getContentChanges"> + <soap:operation soapAction="getContentChanges"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="MultiFilingServicePortBinding" type="cmisw:MultiFilingServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="addObjectToFolder"> + <soap:operation soapAction="addObjectToFolder"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="removeObjectFromFolder"> + <soap:operation soapAction="removeObjectFromFolder"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="NavigationServicePortBinding" type="cmisw:NavigationServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getDescendants"> + <soap:operation soapAction="getDescendants"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getChildren"> + <soap:operation soapAction="getChildren"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getFolderParent"> + <soap:operation soapAction="getFolderParent"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getFolderTree"> + <soap:operation soapAction="getFolderTree"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getObjectParents"> + <soap:operation soapAction="getObjectParents"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getCheckedOutDocs"> + <soap:operation soapAction="getCheckedOutDocs"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="ObjectServicePortBinding" type="cmisw:ObjectServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="createDocument"> + <soap:operation soapAction="createDocument"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="createDocumentFromSource"> + <soap:operation soapAction="createDocumentFromSource"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="createFolder"> + <soap:operation soapAction="createFolder"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="createRelationship"> + <soap:operation soapAction="createRelationship"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="createPolicy"> + <soap:operation soapAction="createPolicy"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="createItem"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getAllowableActions"> + <soap:operation soapAction="getAllowableActions"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getObject"> + <soap:operation soapAction="getObject"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getProperties"> + <soap:operation soapAction="getProperties"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getRenditions"> + <soap:operation soapAction="getRenditions"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getObjectByPath"> + <soap:operation soapAction="getObjectByPath"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getContentStream"> + <soap:operation soapAction="getContentStream"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="updateProperties"> + <soap:operation soapAction="updateProperties"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="bulkUpdateProperties"> + <soap:operation soapAction="bulkUpdateProperties"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="moveObject"> + <soap:operation soapAction="moveObject"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="deleteObject"> + <soap:operation soapAction="deleteObject"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="deleteTree"> + <soap:operation soapAction="deleteTree"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="setContentStream"> + <soap:operation soapAction="setContentStream"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="appendContentStream"> + <soap:operation soapAction="appendContentStream"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="deleteContentStream"> + <soap:operation soapAction="deleteContentStream"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="PolicyServicePortBinding" type="cmisw:PolicyServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="applyPolicy"> + <soap:operation soapAction="applyPolicy"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="removePolicy"> + <soap:operation soapAction="removePolicy"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getAppliedPolicies"> + <soap:operation soapAction="getAppliedPolicies"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="RelationshipServicePortBinding" type="cmisw:RelationshipServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getObjectRelationships"> + <soap:operation soapAction="getObjectRelationships"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="RepositoryServicePortBinding" type="cmisw:RepositoryServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getRepositories"> + <soap:operation soapAction="getRepositories"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getRepositoryInfo"> + <soap:operation soapAction="getRepositoryInfo"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getTypeChildren"> + <soap:operation soapAction="getTypeChildren"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getTypeDescendants"> + <soap:operation soapAction="getTypeDescendants"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getTypeDefinition"> + <soap:operation soapAction="getTypeDefinition"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="createType"> + <soap:operation soapAction="createType"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="updateType"> + <soap:operation soapAction="updateType"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="deleteType"> + <soap:operation soapAction="deleteType"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="VersioningServicePortBinding" type="cmisw:VersioningServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="checkOut"> + <soap:operation soapAction="checkOut"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="cancelCheckOut"> + <soap:operation soapAction="cancelCheckOut"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="checkIn"> + <soap:operation soapAction="checkIn"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getObjectOfLatestVersion"> + <soap:operation soapAction="getObjectOfLatestVersion"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getPropertiesOfLatestVersion"> + <soap:operation soapAction="getPropertiesOfLatestVersion"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="getAllVersions"> + <soap:operation soapAction="getAllVersions"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <binding name="ACLServicePortBinding" type="cmisw:ACLServicePort"> + <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> + <operation name="getACL"> + <soap:operation soapAction="getACL"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + <operation name="applyACL"> + <soap:operation soapAction="applyACL"/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + <fault name="cmisException"> + <soap:fault name="cmisException" use="literal"/> + </fault> + </operation> + </binding> + <service name="DiscoveryService"> + <port name="DiscoveryServicePort" binding="cmisw:DiscoveryServicePortBinding"> + <soap:address location="http://mockup/ws/services/DiscoveryService"/> + </port> + </service> + <service name="MultiFilingService"> + <port name="MultiFilingServicePort" binding="cmisw:MultiFilingServicePortBinding"> + <soap:address location="http://mockup/ws/services/MultiFilingService"/> + </port> + </service> + <service name="NavigationService"> + <port name="NavigationServicePort" binding="cmisw:NavigationServicePortBinding"> + <soap:address location="http://mockup/ws/services/NavigationService"/> + </port> + </service> + <service name="ObjectService"> + <port name="ObjectServicePort" binding="cmisw:ObjectServicePortBinding"> + <soap:address location="http://mockup/ws/services/ObjectService"/> + </port> + </service> + <service name="PolicyService"> + <port name="PolicyServicePort" binding="cmisw:PolicyServicePortBinding"> + <soap:address location="http://mockup/ws/services/PolicyService"/> + </port> + </service> + <service name="RelationshipService"> + <port name="RelationshipServicePort" binding="cmisw:RelationshipServicePortBinding"> + <soap:address location="http://mockup/ws/services/RelationshipService"/> + </port> + </service> + <service name="RepositoryService"> + <port name="RepositoryServicePort" binding="cmisw:RepositoryServicePortBinding"> + <soap:address location="http://mockup/ws/services/RepositoryService"/> + </port> + </service> + <service name="VersioningService"> + <port name="VersioningServicePort" binding="cmisw:VersioningServicePortBinding"> + <soap:address location="http://mockup/ws/services/VersioningService"/> + </port> + </service> + <service name="ACLService"> + <port name="ACLServicePort" binding="cmisw:ACLServicePortBinding"> + <soap:address location="http://mockup/ws/services/ACLService"/> + </port> + </service> +</definitions> diff --git a/qa/libcmis/data/ws/cancel-checkout.http b/qa/libcmis/data/ws/cancel-checkout.http new file mode 100644 index 0000000..24a1c71 --- /dev/null +++ b/qa/libcmis/data/ws/cancel-checkout.http @@ -0,0 +1,25 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:cancelCheckOutResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"/> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/checked-in.http b/qa/libcmis/data/ws/checked-in.http new file mode 100644 index 0000000..0fcbb8e --- /dev/null +++ b/qa/libcmis/data/ws/checked-in.http @@ -0,0 +1,144 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>2.0</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>some-other-token</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"> + <cmis:value>Some check-in comment</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>filename.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>true</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>true</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/checkin.http b/qa/libcmis/data/ws/checkin.http new file mode 100644 index 0000000..80868c1 --- /dev/null +++ b/qa/libcmis/data/ws/checkin.http @@ -0,0 +1,27 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:checkInResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>test-document</cmism:objectId> + </cmism:checkInResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/checkout.http b/qa/libcmis/data/ws/checkout.http new file mode 100644 index 0000000..dc4e6aa --- /dev/null +++ b/qa/libcmis/data/ws/checkout.http @@ -0,0 +1,28 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:checkOutResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>working-copy</cmism:objectId> + <cmism:contentCopied>true</cmism:contentCopied> + </cmism:checkOutResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/create-document.http b/qa/libcmis/data/ws/create-document.http new file mode 100644 index 0000000..fce2d65 --- /dev/null +++ b/qa/libcmis/data/ws/create-document.http @@ -0,0 +1,25 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:createDocumentResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>created-document</cmism:objectId> + </cmism:createDocumentResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/create-folder-bad-type.http b/qa/libcmis/data/ws/create-folder-bad-type.http new file mode 100644 index 0000000..9e79cd9 --- /dev/null +++ b/qa/libcmis/data/ws/create-folder-bad-type.http @@ -0,0 +1,33 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <S:Fault> + <faultcode>S:Server</faultcode> + <faultstring>Can't create folder with type cmis:document</faultstring> + <detail> + <cmisFault:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:cmisFault="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/"> + <type>constraint</type> + <code>562</code> + <message>Can't create folder with type cmis:document</message> + </cmisFault:cmisFault> + </detail> + </S:Fault> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/create-folder.http b/qa/libcmis/data/ws/create-folder.http new file mode 100644 index 0000000..5abd72c --- /dev/null +++ b/qa/libcmis/data/ws/create-folder.http @@ -0,0 +1,25 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:createFolderResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>created-folder</cmism:objectId> + </cmism:createFolderResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/created-document.http b/qa/libcmis/data/ws/created-document.http new file mode 100644 index 0000000..72a1bc8 --- /dev/null +++ b/qa/libcmis/data/ws/created-document.http @@ -0,0 +1,85 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>create document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>create-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/created-folder.http b/qa/libcmis/data/ws/created-folder.http new file mode 100644 index 0000000..0e76c03 --- /dev/null +++ b/qa/libcmis/data/ws/created-folder.http @@ -0,0 +1,64 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/create folder</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>create folder</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>create-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/delete-object.http b/qa/libcmis/data/ws/delete-object.http new file mode 100644 index 0000000..eaac13d --- /dev/null +++ b/qa/libcmis/data/ws/delete-object.http @@ -0,0 +1,23 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:deleteObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"/> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/delete-tree.http b/qa/libcmis/data/ws/delete-tree.http new file mode 100644 index 0000000..b46c680 --- /dev/null +++ b/qa/libcmis/data/ws/delete-tree.http @@ -0,0 +1,27 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:deleteTreeResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:failedToDelete> + <cmism:objectIds>bad-delete</cmism:objectIds> + </cmism:failedToDelete> + </cmism:deleteTreeResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/get-content-stream.http b/qa/libcmis/data/ws/get-content-stream.http new file mode 100644 index 0000000..3ea7c59 --- /dev/null +++ b/qa/libcmis/data/ws/get-content-stream.http @@ -0,0 +1,37 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getContentStreamResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:contentStream> + <cmism:mimeType>text/plain</cmism:mimeType> + <cmism:filename>test.txt</cmism:filename> + <cmism:stream> + <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" + href="cid:stream*someid"/></cmism:stream> + </cmism:contentStream> + </cmism:getContentStreamResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <stream*someid> +Content-Type: application/xop+xml;charset=utf-8;type="text/plain" +Content-Transfer-Encoding: binary + +Some content stream +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/get-renditions.http b/qa/libcmis/data/ws/get-renditions.http new file mode 100644 index 0000000..383c888 --- /dev/null +++ b/qa/libcmis/data/ws/get-renditions.http @@ -0,0 +1,41 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getRenditionsResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:renditions> + <cmis:streamId>test-document-rendition1</cmis:streamId> + <cmis:mimetype>image/png</cmis:mimetype> + <cmis:length>40385</cmis:length> + <cmis:kind>cmis:thumbnail</cmis:kind> + <cmis:title>picture</cmis:title> + <cmis:height>100</cmis:height> + <cmis:width>100</cmis:width> + </cmism:renditions> + <cmism:renditions> + <cmis:streamId>test-document-rendition2</cmis:streamId> + <cmis:mimetype>application/pdf</cmis:mimetype> + <cmis:kind>pdf</cmis:kind> + <cmis:title>Doc as PDF</cmis:title> + </cmism:renditions> + </cmism:getRenditionsResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/get-versions.http b/qa/libcmis/data/ws/get-versions.http new file mode 100644 index 0000000..68e2956 --- /dev/null +++ b/qa/libcmis/data/ws/get-versions.http @@ -0,0 +1,204 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getAllVersionsResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objects> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>version-series</cmis:value> + </cmis:propertyId> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>1.0</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206736</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document-1</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document-1</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:objects> + <cmism:objects> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>version-series</cmis:value> + </cmis:propertyId> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>0.1</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-27T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359382206754</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document-0</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-27T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document-0</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:objects> + </cmism:getAllVersionsResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/getbypath-bad.http b/qa/libcmis/data/ws/getbypath-bad.http new file mode 100644 index 0000000..e641af8 --- /dev/null +++ b/qa/libcmis/data/ws/getbypath-bad.http @@ -0,0 +1,33 @@ +Content-Type: multipart/related;start="<rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8";start-info="text/xml" + +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8 +Content-Id: <rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version="1.0" encoding="UTF-8"?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-30T19:54:27Z</Created> + <Expires>2013-10-01T19:54:27Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <S:Fault> + <faultcode>S:Server</faultcode> + <faultstring>Path '/some/invalid/path' not found</faultstring> + <detail> + <cmisFault:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:cmisFault="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/"> + <type>objectNotFound</type> + <code>562</code> + <message>Path not found: '/some/invalid/path'</message> + </cmisFault:cmisFault> + </detail> + </S:Fault> + </S:Body> +</S:Envelope> +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8-- + diff --git a/qa/libcmis/data/ws/move-object.http b/qa/libcmis/data/ws/move-object.http new file mode 100644 index 0000000..1399a33 --- /dev/null +++ b/qa/libcmis/data/ws/move-object.http @@ -0,0 +1,27 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:moveObjectResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>test-document</cmism:objectId> + </cmism:moveObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/repositories.http b/qa/libcmis/data/ws/repositories.http new file mode 100644 index 0000000..74ae6ca --- /dev/null +++ b/qa/libcmis/data/ws/repositories.http @@ -0,0 +1,25 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <ns2:getRepositoriesResponse xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <ns2:repositories><ns2:repositoryId>mock</ns2:repositoryId><ns2:repositoryName>Mockup</ns2:repositoryName></ns2:repositories> + </ns2:getRepositoriesResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/repository-infos-bad.http b/qa/libcmis/data/ws/repository-infos-bad.http new file mode 100644 index 0000000..fc6e676 --- /dev/null +++ b/qa/libcmis/data/ws/repository-infos-bad.http @@ -0,0 +1,33 @@ +Content-Type: multipart/related;start="<rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8";start-info="text/xml" + +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8 +Content-Id: <rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version="1.0" encoding="UTF-8"?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-30T19:54:27Z</Created> + <Expires>2013-10-01T19:54:27Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <S:Fault> + <faultcode>S:Server</faultcode> + <faultstring>Repository 'bad' not found</faultstring> + <detail> + <cmisFault:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:cmisFault="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/"> + <type>invalidArgument</type> + <code>562</code> + <message>Unknown repository id: 'bad'</message> + </cmisFault:cmisFault> + </detail> + </S:Fault> + </S:Body> +</S:Envelope> +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8-- + diff --git a/qa/libcmis/data/ws/repository-infos.http b/qa/libcmis/data/ws/repository-infos.http new file mode 100644 index 0000000..75f3ec8 --- /dev/null +++ b/qa/libcmis/data/ws/repository-infos.http @@ -0,0 +1,207 @@ +Content-Type: multipart/related;start="<rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8";start-info="text/xml" + +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8 +Content-Id: <rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version="1.0" encoding="UTF-8"?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-30T19:54:27Z</Created> + <Expires>2013-10-01T19:54:27Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <getRepositoryInfoResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"> + <repositoryInfo> + <cmis:repositoryId>mock</cmis:repositoryId> + <cmis:repositoryName>Mockup</cmis:repositoryName> + <cmis:repositoryDescription>Repository sent by mockup server</cmis:repositoryDescription> + <cmis:vendorName>libcmis</cmis:vendorName> + <cmis:productName>Libcmis mockup</cmis:productName> + <cmis:productVersion>some-version</cmis:productVersion> + <cmis:rootFolderId>root-folder</cmis:rootFolderId> + <cmis:latestChangeLogToken>0</cmis:latestChangeLogToken> + <cmis:capabilities> + <cmis:capabilityACL>manage</cmis:capabilityACL> + <cmis:capabilityAllVersionsSearchable>false</cmis:capabilityAllVersionsSearchable> + <cmis:capabilityChanges>none</cmis:capabilityChanges> + <cmis:capabilityContentStreamUpdatability>anytime</cmis:capabilityContentStreamUpdatability> + <cmis:capabilityGetDescendants>true</cmis:capabilityGetDescendants> + <cmis:capabilityGetFolderTree>true</cmis:capabilityGetFolderTree> + <cmis:capabilityMultifiling>true</cmis:capabilityMultifiling> + <cmis:capabilityPWCSearchable>false</cmis:capabilityPWCSearchable> + <cmis:capabilityPWCUpdatable>true</cmis:capabilityPWCUpdatable> + <cmis:capabilityQuery>bothcombined</cmis:capabilityQuery> + <cmis:capabilityRenditions>read</cmis:capabilityRenditions> + <cmis:capabilityUnfiling>true</cmis:capabilityUnfiling> + <cmis:capabilityVersionSpecificFiling>false</cmis:capabilityVersionSpecificFiling> + <cmis:capabilityJoin>none</cmis:capabilityJoin> + </cmis:capabilities> + <cmis:aclCapability> + <cmis:supportedPermissions>basic</cmis:supportedPermissions> + <cmis:propagation>objectonly</cmis:propagation> + <cmis:permissions> + <cmis:permission>cmis:read</cmis:permission> + <cmis:description>Read</cmis:description> + </cmis:permissions> + <cmis:permissions> + <cmis:permission>cmis:write</cmis:permission> + <cmis:description>Write</cmis:description> + </cmis:permissions> + <cmis:permissions> + <cmis:permission>cmis:all</cmis:permission> + <cmis:description>All</cmis:description> + </cmis:permissions> + <cmis:mapping> + <cmis:key>canGetDescendents.Folder</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetChildren.Folder</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetParents.Folder</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetFolderParent.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateDocument.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateFolder.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateRelationship.Source</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCreateRelationship.Target</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetProperties.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canViewContent.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canUpdateProperties.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canMove.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canMove.Target</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canMove.Source</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canDelete.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canDeleteTree.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canSetContent.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canDeleteContent.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddToFolder.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddToFolder.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemoveFromFolder.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemoveFromFolder.Folder</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCheckout.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCancelCheckout.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canCheckin.Document</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetAllVersions.VersionSeries</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetObjectRelationships.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddPolicy.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canAddPolicy.Policy</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemovePolicy.Object</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canRemovePolicy.Policy</cmis:key> + <cmis:permission>cmis:write</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetAppliedPolicies.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canGetACL.Object</cmis:key> + <cmis:permission>cmis:read</cmis:permission> + </cmis:mapping> + <cmis:mapping> + <cmis:key>canApplyACL.Object</cmis:key> + <cmis:permission>cmis:all</cmis:permission> + </cmis:mapping> + </cmis:aclCapability> + <cmis:cmisVersionSupported>1.0</cmis:cmisVersionSupported> + <cmis:thinClientURI/> + <cmis:changesIncomplete>true</cmis:changesIncomplete> + <cmis:principalAnonymous>anonymous</cmis:principalAnonymous> + <cmis:principalAnyone>anyone</cmis:principalAnyone> + </repositoryInfo> + </getRepositoryInfoResponse> + </S:Body> +</S:Envelope> +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8-- + diff --git a/qa/libcmis/data/ws/root-children.http b/qa/libcmis/data/ws/root-children.http new file mode 100644 index 0000000..0d43497 --- /dev/null +++ b/qa/libcmis/data/ws/root-children.http @@ -0,0 +1,292 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getChildrenResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objects> + <cmism:objects> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>33446</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 1</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:13.932Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537973932</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child1</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:13.932Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>33537</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 2</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:13.978Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537973978</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child2</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:13.978Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>33353</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 3</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:14.031Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537974031</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child3</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:14.031Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Child 4</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 4</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child4</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:12.384Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537972384</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:12.384Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Child 5</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Child 5</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>child5</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-30T09:26:13.338Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359537973338</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-30T09:26:13.338Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + </cmism:objects> + </cmism:objects> + </cmism:getChildrenResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/root-folder.http b/qa/libcmis/data/ws/root-folder.http new file mode 100644 index 0000000..5639383 --- /dev/null +++ b/qa/libcmis/data/ws/root-folder.http @@ -0,0 +1,93 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Root Folder</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"/> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>true</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>true</cmis:canGetFolderParent> + <cmis:canGetDescendants>true</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>false</cmis:canDeleteContentStream> + <cmis:canCheckOut>false</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>false</cmis:canSetContentStream> + <cmis:canGetAllVersions>false</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>false</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>false</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>false</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>true</cmis:canGetChildren> + <cmis:canCreateDocument>true</cmis:canCreateDocument> + <cmis:canCreateFolder>true</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>true</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/secondary-type.http b/qa/libcmis/data/ws/secondary-type.http new file mode 100644 index 0000000..0d88b5b --- /dev/null +++ b/qa/libcmis/data/ws/secondary-type.http @@ -0,0 +1,57 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeDefinitionResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:type> + <cmis:id>secondary-type</cmis:id> + <cmis:localName>secondary-type</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Secondary Type</cmis:displayName> + <cmis:queryName>secondary-type</cmis:queryName> + <cmis:description>Description of Secondary Type</cmis:description> + <cmis:baseId>cmis:secondary</cmis:baseId> + <cmis:parentId>cmis:secondary</cmis:parentId> + <cmis:creatable>false</cmis:creatable> + <cmis:fileable>false</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>false</cmis:controllableACL> + <cmis:propertyStringDefinition> + <cmis:id>secondary-prop</cmis:id> + <cmis:localName>secondary-prop</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>secondary-prop</cmis:displayName> + <cmis:queryName>secondary-prop</cmis:queryName> + <cmis:description>This is a Secondary type property</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + </cmism:type> + </cmism:getTypeDefinitionResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/set-content-stream.http b/qa/libcmis/data/ws/set-content-stream.http new file mode 100644 index 0000000..9112cc1 --- /dev/null +++ b/qa/libcmis/data/ws/set-content-stream.http @@ -0,0 +1,28 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:setContentStreamResponse + xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" + xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>test-document</cmism:objectId> + <cmism:changeToken>set-content-token</cmism:changeToken> + </cmism:setContentStreamResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/test-document-add-secondary.http b/qa/libcmis/data/ws/test-document-add-secondary.http new file mode 100644 index 0000000..88433a9 --- /dev/null +++ b/qa/libcmis/data/ws/test-document-add-secondary.http @@ -0,0 +1,148 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>series-id</cmis:value> + </cmis:propertyId> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>some-change-token</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:secondaryObjectTypeIds" displayName="cmis:secondaryObjectTypeIds" localName="cmis:secondaryObjectTypeIds" propertyDefinitionId="cmis:secondaryObjectTypeIds"> + <cmis:value>secondary-type</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="secondary-prop" displayName="secondary-prop" localName="secondary-prop" propertyDefinitionId="secondary-prop"> + <cmis:value>some-value</cmis:value> + </cmis:propertyString> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>true</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>true</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/test-document-parents.http b/qa/libcmis/data/ws/test-document-parents.http new file mode 100644 index 0000000..1c5e398 --- /dev/null +++ b/qa/libcmis/data/ws/test-document-parents.http @@ -0,0 +1,106 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectParentsResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:parents> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Parent 1</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Parent 1</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>parent1</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-31T08:04:35.866Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359619475867</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-31T08:04:35.867Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Parent 2</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Parent 2</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>parent2</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-31T08:04:35.866Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1359619475867</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-31T08:04:35.867Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + </cmism:object> + </cmism:parents> + </cmism:getObjectParentsResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/test-document-updated.http b/qa/libcmis/data/ws/test-document-updated.http new file mode 100644 index 0000000..a5c34e9 --- /dev/null +++ b/qa/libcmis/data/ws/test-document-updated.http @@ -0,0 +1,140 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>New name</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>some-new-change-token</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>true</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>true</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/test-document.http b/qa/libcmis/data/ws/test-document.http new file mode 100644 index 0000000..890274c --- /dev/null +++ b/qa/libcmis/data/ws/test-document.http @@ -0,0 +1,142 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> + <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> + <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> + <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> + <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>series-id</cmis:value> + </cmis:propertyId> + <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> + <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> + <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> + <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:propertyString> + <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> + <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> + <cmis:value>My Doc StringProperty 6</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>some-change-token</cmis:value> + </cmis:propertyString> + <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> + <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> + <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>test-document</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>false</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>false</cmis:canGetFolderParent> + <cmis:canGetDescendants>false</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> + <cmis:canCheckOut>true</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>true</cmis:canSetContentStream> + <cmis:canGetAllVersions>true</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>true</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>false</cmis:canGetChildren> + <cmis:canCreateDocument>false</cmis:canCreateDocument> + <cmis:canCreateFolder>false</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>false</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/type-bad.http b/qa/libcmis/data/ws/type-bad.http new file mode 100644 index 0000000..69825e7 --- /dev/null +++ b/qa/libcmis/data/ws/type-bad.http @@ -0,0 +1,33 @@ +Content-Type: multipart/related;start="<rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8";start-info="text/xml" + +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8 +Content-Id: <rootpart*abd9e41c-b3aa-40a7-a73a-997c472010e8@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version="1.0" encoding="UTF-8"?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-30T19:54:27Z</Created> + <Expires>2013-10-01T19:54:27Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <S:Fault> + <faultcode>S:Server</faultcode> + <faultstring>Type 'bad' not found</faultstring> + <detail> + <cmisFault:cmisFault xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:cmisFault="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/"> + <type>objectNotFound</type> + <code>562</code> + <message>Unknown type id: 'bad'</message> + </cmisFault:cmisFault> + </detail> + </S:Fault> + </S:Body> +</S:Envelope> +--uuid:abd9e41c-b3aa-40a7-a73a-997c472010e8-- + diff --git a/qa/libcmis/data/ws/type-docLevel1.http b/qa/libcmis/data/ws/type-docLevel1.http new file mode 100644 index 0000000..5320af2 --- /dev/null +++ b/qa/libcmis/data/ws/type-docLevel1.http @@ -0,0 +1,411 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeDefinitionResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:type> + <cmis:id>DocumentLevel1</cmis:id> + <cmis:localName>DocumentLevel1</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 1</cmis:displayName> + <cmis:queryName>DocumentLevel1</cmis:queryName> + <cmis:description>Description of Document Level 1 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>cmis:document</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmism:type> + </cmism:getTypeDefinitionResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/type-docLevel2-secondary.http b/qa/libcmis/data/ws/type-docLevel2-secondary.http new file mode 100644 index 0000000..7ea2313 --- /dev/null +++ b/qa/libcmis/data/ws/type-docLevel2-secondary.http @@ -0,0 +1,698 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeDefinitionResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:type> + <cmis:id>DocumentLevel2</cmis:id> + <cmis:localName>DocumentLevel2</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 2</cmis:displayName> + <cmis:queryName>DocumentLevel2</cmis:queryName> + <cmis:description>Description of Document Level 2 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>DocumentLevel1</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyHtmlDefinition> + <cmis:id>HtmlProp</cmis:id> + <cmis:localName>HtmlProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Html Property</cmis:displayName> + <cmis:queryName>HtmlProp</cmis:queryName> + <cmis:description>This is a Sample Html Property property.</cmis:description> + <cmis:propertyType>html</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyHtmlDefinition> + <cmis:propertyIdDefinition> + <cmis:id>IdProp</cmis:id> + <cmis:localName>IdProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Id Property</cmis:displayName> + <cmis:queryName>IdProp</cmis:queryName> + <cmis:description>This is a Sample Id Property property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>DateTimePropMV</cmis:id> + <cmis:localName>DateTimePropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample DateTime multi-value Property</cmis:displayName> + <cmis:queryName>DateTimePropMV</cmis:queryName> + <cmis:description>This is a Sample DateTime multi-value Property property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyUriDefinition> + <cmis:id>UriProp</cmis:id> + <cmis:localName>UriProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Uri Property</cmis:displayName> + <cmis:queryName>UriProp</cmis:queryName> + <cmis:description>This is a Sample Uri Property property.</cmis:description> + <cmis:propertyType>uri</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyUriDefinition> + <cmis:propertyDecimalDefinition> + <cmis:id>DecimalProp</cmis:id> + <cmis:localName>DecimalProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Decimal Property</cmis:displayName> + <cmis:queryName>DecimalProp</cmis:queryName> + <cmis:description>This is a Sample Decimal Property property.</cmis:description> + <cmis:propertyType>decimal</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDecimalDefinition> + <cmis:propertyUriDefinition> + <cmis:id>UriPropMV</cmis:id> + <cmis:localName>UriPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Uri multi-value Property</cmis:displayName> + <cmis:queryName>UriPropMV</cmis:queryName> + <cmis:description>This is a Sample Uri multi-value Property property.</cmis:description> + <cmis:propertyType>uri</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyUriDefinition> + <cmis:propertyIdDefinition> + <cmis:id>IdPropMV</cmis:id> + <cmis:localName>IdPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Id Html multi-value Property</cmis:displayName> + <cmis:queryName>IdPropMV</cmis:queryName> + <cmis:description>This is a Sample Id Html multi-value Property property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>PickListProp</cmis:id> + <cmis:localName>PickListProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Pick List Property</cmis:displayName> + <cmis:queryName>PickListProp</cmis:queryName> + <cmis:description>This is a Sample Pick List Property property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + <cmis:defaultValue propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:defaultValue> + <cmis:choice displayName=""> + <cmis:value>red</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>green</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>blue</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>black</cmis:value> + </cmis:choice> + </cmis:propertyStringDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>IntProp</cmis:id> + <cmis:localName>IntProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Int Property</cmis:displayName> + <cmis:queryName>IntProp</cmis:queryName> + <cmis:description>This is a Sample Int Property property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyHtmlDefinition> + <cmis:id>HtmlPropMV</cmis:id> + <cmis:localName>HtmlPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Html multi-value Property</cmis:displayName> + <cmis:queryName>HtmlPropMV</cmis:queryName> + <cmis:description>This is a Sample Html multi-value Property property.</cmis:description> + <cmis:propertyType>html</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyHtmlDefinition> + <cmis:propertyStringDefinition> + <cmis:id>StringProp</cmis:id> + <cmis:localName>StringProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample String Property</cmis:displayName> + <cmis:queryName>StringProp</cmis:queryName> + <cmis:description>This is a Sample String Property property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDecimalDefinition> + <cmis:id>DecimalPropMV</cmis:id> + <cmis:localName>DecimalPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Decimal multi-value Property</cmis:displayName> + <cmis:queryName>DecimalPropMV</cmis:queryName> + <cmis:description>This is a Sample Decimal multi-value Property property.</cmis:description> + <cmis:propertyType>decimal</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDecimalDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>DateTimeProp</cmis:id> + <cmis:localName>DateTimeProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample DateTime Property</cmis:displayName> + <cmis:queryName>DateTimeProp</cmis:queryName> + <cmis:description>This is a Sample DateTime Property property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>BooleanProp</cmis:id> + <cmis:localName>BooleanProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Boolean Property</cmis:displayName> + <cmis:queryName>BooleanProp</cmis:queryName> + <cmis:description>This is a Sample Boolean Property property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>BooleanPropMV</cmis:id> + <cmis:localName>BooleanPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Boolean multi-value Property</cmis:displayName> + <cmis:queryName>BooleanPropMV</cmis:queryName> + <cmis:description>This is a Sample Boolean multi-value Property property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>IntPropMV</cmis:id> + <cmis:localName>IntPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Int multi-value Property</cmis:displayName> + <cmis:queryName>IntPropMV</cmis:queryName> + <cmis:description>This is a Sample Int multi-value Property property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:secondaryObjectTypeIds</cmis:id> + <cmis:localName>cmis:secondaryObjectTypeIds</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>cmis:secondaryObjectTypeIds</cmis:displayName> + <cmis:queryName>cmis:secondaryObjectTypeIds</cmis:queryName> + <cmis:description>This the property holding the Ids of the secondary types.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmism:type> + </cmism:getTypeDefinitionResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/type-docLevel2.http b/qa/libcmis/data/ws/type-docLevel2.http new file mode 100644 index 0000000..2524387 --- /dev/null +++ b/qa/libcmis/data/ws/type-docLevel2.http @@ -0,0 +1,682 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeDefinitionResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:type> + <cmis:id>DocumentLevel2</cmis:id> + <cmis:localName>DocumentLevel2</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 2</cmis:displayName> + <cmis:queryName>DocumentLevel2</cmis:queryName> + <cmis:description>Description of Document Level 2 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>DocumentLevel1</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyHtmlDefinition> + <cmis:id>HtmlProp</cmis:id> + <cmis:localName>HtmlProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Html Property</cmis:displayName> + <cmis:queryName>HtmlProp</cmis:queryName> + <cmis:description>This is a Sample Html Property property.</cmis:description> + <cmis:propertyType>html</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyHtmlDefinition> + <cmis:propertyIdDefinition> + <cmis:id>IdProp</cmis:id> + <cmis:localName>IdProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Id Property</cmis:displayName> + <cmis:queryName>IdProp</cmis:queryName> + <cmis:description>This is a Sample Id Property property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>DateTimePropMV</cmis:id> + <cmis:localName>DateTimePropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample DateTime multi-value Property</cmis:displayName> + <cmis:queryName>DateTimePropMV</cmis:queryName> + <cmis:description>This is a Sample DateTime multi-value Property property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyUriDefinition> + <cmis:id>UriProp</cmis:id> + <cmis:localName>UriProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Uri Property</cmis:displayName> + <cmis:queryName>UriProp</cmis:queryName> + <cmis:description>This is a Sample Uri Property property.</cmis:description> + <cmis:propertyType>uri</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyUriDefinition> + <cmis:propertyDecimalDefinition> + <cmis:id>DecimalProp</cmis:id> + <cmis:localName>DecimalProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Decimal Property</cmis:displayName> + <cmis:queryName>DecimalProp</cmis:queryName> + <cmis:description>This is a Sample Decimal Property property.</cmis:description> + <cmis:propertyType>decimal</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDecimalDefinition> + <cmis:propertyUriDefinition> + <cmis:id>UriPropMV</cmis:id> + <cmis:localName>UriPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Uri multi-value Property</cmis:displayName> + <cmis:queryName>UriPropMV</cmis:queryName> + <cmis:description>This is a Sample Uri multi-value Property property.</cmis:description> + <cmis:propertyType>uri</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyUriDefinition> + <cmis:propertyIdDefinition> + <cmis:id>IdPropMV</cmis:id> + <cmis:localName>IdPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Id Html multi-value Property</cmis:displayName> + <cmis:queryName>IdPropMV</cmis:queryName> + <cmis:description>This is a Sample Id Html multi-value Property property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>PickListProp</cmis:id> + <cmis:localName>PickListProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Pick List Property</cmis:displayName> + <cmis:queryName>PickListProp</cmis:queryName> + <cmis:description>This is a Sample Pick List Property property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + <cmis:defaultValue propertyDefinitionId="PickListProp"> + <cmis:value>blue</cmis:value> + </cmis:defaultValue> + <cmis:choice displayName=""> + <cmis:value>red</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>green</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>blue</cmis:value> + </cmis:choice> + <cmis:choice displayName=""> + <cmis:value>black</cmis:value> + </cmis:choice> + </cmis:propertyStringDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>IntProp</cmis:id> + <cmis:localName>IntProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Int Property</cmis:displayName> + <cmis:queryName>IntProp</cmis:queryName> + <cmis:description>This is a Sample Int Property property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyHtmlDefinition> + <cmis:id>HtmlPropMV</cmis:id> + <cmis:localName>HtmlPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Html multi-value Property</cmis:displayName> + <cmis:queryName>HtmlPropMV</cmis:queryName> + <cmis:description>This is a Sample Html multi-value Property property.</cmis:description> + <cmis:propertyType>html</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyHtmlDefinition> + <cmis:propertyStringDefinition> + <cmis:id>StringProp</cmis:id> + <cmis:localName>StringProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample String Property</cmis:displayName> + <cmis:queryName>StringProp</cmis:queryName> + <cmis:description>This is a Sample String Property property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDecimalDefinition> + <cmis:id>DecimalPropMV</cmis:id> + <cmis:localName>DecimalPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Decimal multi-value Property</cmis:displayName> + <cmis:queryName>DecimalPropMV</cmis:queryName> + <cmis:description>This is a Sample Decimal multi-value Property property.</cmis:description> + <cmis:propertyType>decimal</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDecimalDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>DateTimeProp</cmis:id> + <cmis:localName>DateTimeProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample DateTime Property</cmis:displayName> + <cmis:queryName>DateTimeProp</cmis:queryName> + <cmis:description>This is a Sample DateTime Property property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>BooleanProp</cmis:id> + <cmis:localName>BooleanProp</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Boolean Property</cmis:displayName> + <cmis:queryName>BooleanProp</cmis:queryName> + <cmis:description>This is a Sample Boolean Property property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>BooleanPropMV</cmis:id> + <cmis:localName>BooleanPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Boolean multi-value Property</cmis:displayName> + <cmis:queryName>BooleanPropMV</cmis:queryName> + <cmis:description>This is a Sample Boolean multi-value Property property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>IntPropMV</cmis:id> + <cmis:localName>IntPropMV</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Sample Int multi-value Property</cmis:displayName> + <cmis:queryName>IntPropMV</cmis:queryName> + <cmis:description>This is a Sample Int multi-value Property property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmism:type> + </cmism:getTypeDefinitionResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/type-document.http b/qa/libcmis/data/ws/type-document.http new file mode 100644 index 0000000..7cda82b --- /dev/null +++ b/qa/libcmis/data/ws/type-document.http @@ -0,0 +1,410 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeDefinitionResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:type> + <cmis:id>cmis:document</cmis:id> + <cmis:localName>cmis:document</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>CMIS Document</cmis:displayName> + <cmis:queryName>cmis:document</cmis:queryName> + <cmis:description>Description of CMIS Document Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmism:type> + </cmism:getTypeDefinitionResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/type-folder.http b/qa/libcmis/data/ws/type-folder.http new file mode 100644 index 0000000..bb47d01 --- /dev/null +++ b/qa/libcmis/data/ws/type-folder.http @@ -0,0 +1,232 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeDefinitionResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:type> + <cmis:id>cmis:folder</cmis:id> + <cmis:localName>cmis:folder</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>CMIS Folder</cmis:displayName> + <cmis:queryName>cmis:folder</cmis:queryName> + <cmis:description>Description of CMIS Folder Type</cmis:description> + <cmis:baseId>cmis:folder</cmis:baseId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyIdDefinition> + <cmis:id>cmis:allowedChildObjectTypeIds</cmis:id> + <cmis:localName>cmis:allowedChildObjectTypeIds</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Allowed Child Types</cmis:displayName> + <cmis:queryName>cmis:allowedChildObjectTypeIds</cmis:queryName> + <cmis:description>This is a Allowed Child Types property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>multi</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:path</cmis:id> + <cmis:localName>cmis:path</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Path</cmis:displayName> + <cmis:queryName>cmis:path</cmis:queryName> + <cmis:description>This is a Path property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:parentId</cmis:id> + <cmis:localName>cmis:parentId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Parent Id</cmis:displayName> + <cmis:queryName>cmis:parentId</cmis:queryName> + <cmis:description>This is a Parent Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>false</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + </cmism:type> + </cmism:getTypeDefinitionResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/typechildren-document.http b/qa/libcmis/data/ws/typechildren-document.http new file mode 100644 index 0000000..d7df653 --- /dev/null +++ b/qa/libcmis/data/ws/typechildren-document.http @@ -0,0 +1,413 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getTypeChildrenResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:types> + <cmism:types> + <cmis:id>DocumentLevel1</cmis:id> + <cmis:localName>DocumentLevel1</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Document Level 1</cmis:displayName> + <cmis:queryName>DocumentLevel1</cmis:queryName> + <cmis:description>Description of Document Level 1 Type</cmis:description> + <cmis:baseId>cmis:document</cmis:baseId> + <cmis:parentId>cmis:document</cmis:parentId> + <cmis:creatable>true</cmis:creatable> + <cmis:fileable>true</cmis:fileable> + <cmis:queryable>false</cmis:queryable> + <cmis:fulltextIndexed>false</cmis:fulltextIndexed> + <cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery> + <cmis:controllablePolicy>false</cmis:controllablePolicy> + <cmis:controllableACL>true</cmis:controllableACL> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestMajorVersion</cmis:id> + <cmis:localName>cmis:isLatestMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Major Version</cmis:displayName> + <cmis:queryName>cmis:isLatestMajorVersion</cmis:queryName> + <cmis:description>This is a Is Latest Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:contentStreamId</cmis:id> + <cmis:localName>cmis:contentStreamId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Stream Id</cmis:displayName> + <cmis:queryName>cmis:contentStreamId</cmis:queryName> + <cmis:description>This is a Stream Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIntegerDefinition> + <cmis:id>cmis:contentStreamLength</cmis:id> + <cmis:localName>cmis:contentStreamLength</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Content Length</cmis:displayName> + <cmis:queryName>cmis:contentStreamLength</cmis:queryName> + <cmis:description>This is a Content Length property.</cmis:description> + <cmis:propertyType>integer</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIntegerDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionSeriesCheckedOutBy</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out By</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutBy</cmis:queryName> + <cmis:description>This is a Checked Out By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectTypeId</cmis:id> + <cmis:localName>cmis:objectTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Type-Id</cmis:displayName> + <cmis:queryName>cmis:objectTypeId</cmis:queryName> + <cmis:description>This is a Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>oncreate</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesCheckedOutId</cmis:id> + <cmis:localName>cmis:versionSeriesCheckedOutId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesCheckedOutId</cmis:queryName> + <cmis:description>This is a Checked Out Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:name</cmis:id> + <cmis:localName>cmis:name</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Name</cmis:displayName> + <cmis:queryName>cmis:name</cmis:queryName> + <cmis:description>This is a Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readwrite</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>true</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamMimeType</cmis:id> + <cmis:localName>cmis:contentStreamMimeType</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Mime Type</cmis:displayName> + <cmis:queryName>cmis:contentStreamMimeType</cmis:queryName> + <cmis:description>This is a Mime Type property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:versionSeriesId</cmis:id> + <cmis:localName>cmis:versionSeriesId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Series Id</cmis:displayName> + <cmis:queryName>cmis:versionSeriesId</cmis:queryName> + <cmis:description>This is a Version Series Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:creationDate</cmis:id> + <cmis:localName>cmis:creationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Creation Date</cmis:displayName> + <cmis:queryName>cmis:creationDate</cmis:queryName> + <cmis:description>This is a Creation Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:changeToken</cmis:id> + <cmis:localName>cmis:changeToken</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Change Token</cmis:displayName> + <cmis:queryName>cmis:changeToken</cmis:queryName> + <cmis:description>This is a Change Token property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isLatestVersion</cmis:id> + <cmis:localName>cmis:isLatestVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Latest Version</cmis:displayName> + <cmis:queryName>cmis:isLatestVersion</cmis:queryName> + <cmis:description>This is a Is Latest Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:versionLabel</cmis:id> + <cmis:localName>cmis:versionLabel</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Version Label</cmis:displayName> + <cmis:queryName>cmis:versionLabel</cmis:queryName> + <cmis:description>This is a Version Label property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isVersionSeriesCheckedOut</cmis:id> + <cmis:localName>cmis:isVersionSeriesCheckedOut</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checked Out</cmis:displayName> + <cmis:queryName>cmis:isVersionSeriesCheckedOut</cmis:queryName> + <cmis:description>This is a Checked Out property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:lastModifiedBy</cmis:id> + <cmis:localName>cmis:lastModifiedBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modified By</cmis:displayName> + <cmis:queryName>cmis:lastModifiedBy</cmis:queryName> + <cmis:description>This is a Modified By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:createdBy</cmis:id> + <cmis:localName>cmis:createdBy</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Created By</cmis:displayName> + <cmis:queryName>cmis:createdBy</cmis:queryName> + <cmis:description>This is a Created By property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:checkinComment</cmis:id> + <cmis:localName>cmis:checkinComment</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Checkin Comment</cmis:displayName> + <cmis:queryName>cmis:checkinComment</cmis:queryName> + <cmis:description>This is a Checkin Comment property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:objectId</cmis:id> + <cmis:localName>cmis:objectId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Object Id</cmis:displayName> + <cmis:queryName>cmis:objectId</cmis:queryName> + <cmis:description>This is a Object Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isMajorVersion</cmis:id> + <cmis:localName>cmis:isMajorVersion</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Is Major Version</cmis:displayName> + <cmis:queryName>cmis:isMajorVersion</cmis:queryName> + <cmis:description>This is a Is Major Version property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyBooleanDefinition> + <cmis:id>cmis:isImmutable</cmis:id> + <cmis:localName>cmis:isImmutable</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Immutable</cmis:displayName> + <cmis:queryName>cmis:isImmutable</cmis:queryName> + <cmis:description>This is a Immutable property.</cmis:description> + <cmis:propertyType>boolean</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyBooleanDefinition> + <cmis:propertyIdDefinition> + <cmis:id>cmis:baseTypeId</cmis:id> + <cmis:localName>cmis:baseTypeId</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Base-Type-Id</cmis:displayName> + <cmis:queryName>cmis:baseTypeId</cmis:queryName> + <cmis:description>This is a Base-Type-Id property.</cmis:description> + <cmis:propertyType>id</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyIdDefinition> + <cmis:propertyDateTimeDefinition> + <cmis:id>cmis:lastModificationDate</cmis:id> + <cmis:localName>cmis:lastModificationDate</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>Modification Date</cmis:displayName> + <cmis:queryName>cmis:lastModificationDate</cmis:queryName> + <cmis:description>This is a Modification Date property.</cmis:description> + <cmis:propertyType>datetime</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyDateTimeDefinition> + <cmis:propertyStringDefinition> + <cmis:id>cmis:contentStreamFileName</cmis:id> + <cmis:localName>cmis:contentStreamFileName</cmis:localName> + <cmis:localNamespace>local</cmis:localNamespace> + <cmis:displayName>File Name</cmis:displayName> + <cmis:queryName>cmis:contentStreamFileName</cmis:queryName> + <cmis:description>This is a File Name property.</cmis:description> + <cmis:propertyType>string</cmis:propertyType> + <cmis:cardinality>single</cmis:cardinality> + <cmis:updatability>readonly</cmis:updatability> + <cmis:inherited>true</cmis:inherited> + <cmis:required>false</cmis:required> + <cmis:queryable>true</cmis:queryable> + <cmis:orderable>true</cmis:orderable> + <cmis:openChoice>false</cmis:openChoice> + </cmis:propertyStringDefinition> + <cmis:versionable>false</cmis:versionable> + <cmis:contentStreamAllowed>allowed</cmis:contentStreamAllowed> + </cmism:types> + </cmism:types> + </cmism:getTypeChildrenResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/update-properties.http b/qa/libcmis/data/ws/update-properties.http new file mode 100644 index 0000000..0113a99 --- /dev/null +++ b/qa/libcmis/data/ws/update-properties.http @@ -0,0 +1,26 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:updatePropertiesResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:objectId>test-document</cmism:objectId> + <cmism:changeToken>some-new-changeToken</cmism:changeToken> + </cmism:updatePropertiesResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/valid-object.http b/qa/libcmis/data/ws/valid-object.http new file mode 100644 index 0000000..5815443 --- /dev/null +++ b/qa/libcmis/data/ws/valid-object.http @@ -0,0 +1,99 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyId queryName="cmis:allowedChildObjectTypeIds" displayName="Allowed Child Types" localName="cmis:allowedChildObjectTypeIds" propertyDefinitionId="cmis:allowedChildObjectTypeIds"> + <cmis:value>*</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path"> + <cmis:value>/Valid Object</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>Admin</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Valid Object</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>valid-object</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2012-11-29T16:14:47.019Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1354205687020</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:folder</cmis:value> + </cmis:propertyId> + <cmis:propertyId queryName="cmis:parentId" displayName="Parent Id" localName="cmis:parentId" propertyDefinitionId="cmis:parentId"> + <cmis:value>root-folder</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2012-11-29T16:14:47.020Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <cmis:allowableActions> + <cmis:canDeleteObject>true</cmis:canDeleteObject> + <cmis:canUpdateProperties>true</cmis:canUpdateProperties> + <cmis:canGetFolderTree>true</cmis:canGetFolderTree> + <cmis:canGetProperties>true</cmis:canGetProperties> + <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> + <cmis:canGetObjectParents>true</cmis:canGetObjectParents> + <cmis:canGetFolderParent>true</cmis:canGetFolderParent> + <cmis:canGetDescendants>true</cmis:canGetDescendants> + <cmis:canMoveObject>true</cmis:canMoveObject> + <cmis:canDeleteContentStream>false</cmis:canDeleteContentStream> + <cmis:canCheckOut>false</cmis:canCheckOut> + <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> + <cmis:canCheckIn>false</cmis:canCheckIn> + <cmis:canSetContentStream>false</cmis:canSetContentStream> + <cmis:canGetAllVersions>false</cmis:canGetAllVersions> + <cmis:canAddObjectToFolder>false</cmis:canAddObjectToFolder> + <cmis:canRemoveObjectFromFolder>false</cmis:canRemoveObjectFromFolder> + <cmis:canGetContentStream>false</cmis:canGetContentStream> + <cmis:canApplyPolicy>false</cmis:canApplyPolicy> + <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> + <cmis:canRemovePolicy>false</cmis:canRemovePolicy> + <cmis:canGetChildren>true</cmis:canGetChildren> + <cmis:canCreateDocument>true</cmis:canCreateDocument> + <cmis:canCreateFolder>true</cmis:canCreateFolder> + <cmis:canCreateRelationship>false</cmis:canCreateRelationship> + <cmis:canDeleteTree>true</cmis:canDeleteTree> + <cmis:canGetRenditions>false</cmis:canGetRenditions> + <cmis:canGetACL>false</cmis:canGetACL> + <cmis:canApplyACL>false</cmis:canApplyACL> + </cmis:allowableActions> + <exampleExtension:exampleExtension xmlns="http://my/cmis/extension" xmlns:exampleExtension="http://my/cmis/extension"> + <objectId xmlns:ns0="http://my/cmis/extension" ns0:type="cmis:folder">valid-object</objectId> + <name>Valid Object</name> + </exampleExtension:exampleExtension> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/data/ws/working-copy.http b/qa/libcmis/data/ws/working-copy.http new file mode 100644 index 0000000..21d2e85 --- /dev/null +++ b/qa/libcmis/data/ws/working-copy.http @@ -0,0 +1,98 @@ +Content-Type: multipart/related;start="<rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:846b7f14-435a-4809-845f-b98822f936ab";start-info="text/xml" + +--uuid:846b7f14-435a-4809-845f-b98822f936ab +Content-Id: <rootpart*846b7f14-435a-4809-845f-b98822f936ab@example.jaxws.sun.com> +Content-Type: application/xop+xml;charset=utf-8;type="text/xml" +Content-Transfer-Encoding: binary + +<?xml version='1.0' encoding='UTF-8'?> +<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> + <S:Header> + <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> + <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> + <Created>2013-09-16T13:34:16Z</Created> + <Expires>2013-09-17T13:34:16Z</Expires> + </Timestamp> + </Security> + </S:Header> + <S:Body> + <cmism:getObjectResponse xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> + <cmism:object> + <cmis:properties> + <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> + <cmis:value>12345</cmis:value> + </cmis:propertyInteger> + <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> + <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> + <cmis:value>DocumentLevel2</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"> + <cmis:value>working-copy</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> + <cmis:value>Test Document</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="VersionedStringProp" displayName="Sample String Property" localName="VersionedStringProp" propertyDefinitionId="VersionedStringProp"/> + <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> + <cmis:value>text/plain</cmis:value> + </cmis:propertyString> + <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"> + <cmis:value>version-series</cmis:value> + </cmis:propertyId> + <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> + <cmis:value>2013-05-21T13:50:45.300Z</cmis:value> + </cmis:propertyDateTime> + <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> + <cmis:value>1369144245300</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"> + <cmis:value>V 0.2</cmis:value> + </cmis:propertyString> + <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> + <cmis:value>true</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> + <cmis:value>unknown</cmis:value> + </cmis:propertyString> + <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> + <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> + <cmis:value>working-copy</cmis:value> + </cmis:propertyId> + <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> + <cmis:value>false</cmis:value> + </cmis:propertyBoolean> + <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> + <cmis:value>cmis:document</cmis:value> + </cmis:propertyId> + <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> + <cmis:value>data.txt</cmis:value> + </cmis:propertyString> + <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> + <cmis:value>2013-05-21T13:50:45.300Z</cmis:value> + </cmis:propertyDateTime> + </cmis:properties> + <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> + <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">working-copy</objectId> + <name>Test Document</name> + </exampleExtension:exampleExtension> + </cmism:object> + </cmism:getObjectResponse> + </S:Body> +</S:Envelope> +--uuid:846b7f14-435a-4809-845f-b98822f936ab-- + diff --git a/qa/libcmis/test-atom.cxx b/qa/libcmis/test-atom.cxx new file mode 100644 index 0000000..f0ce29f --- /dev/null +++ b/qa/libcmis/test-atom.cxx @@ -0,0 +1,1250 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <memory> +#include <sstream> + +#define SERVER_URL string( "http://mockup/binding" ) +#define SERVER_REPOSITORY string( "mock" ) +#define SERVER_USERNAME "tester" +#define SERVER_PASSWORD "somepass" + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <libcmis/document.hxx> +#include <libcmis/session-factory.hxx> + +#include <mockup-config.h> +#include "test-helpers.hxx" +#include "atom-session.hxx" + +using namespace std; +using libcmis::PropertyPtrMap; + +typedef std::unique_ptr<AtomPubSession> AtomPubSessionPtr; + +class AtomTest : public CppUnit::TestFixture +{ + public: + void sessionCreationTest( ); + void sessionCreationBadAuthTest( ); + void sessionCreationProxyTest( ); + void authCallbackTest( ); + void invalidSSLTest( ); + void getRepositoriesTest( ); + void getTypeTest( ); + void getUnexistantTypeTest( ); + void getTypeParentsTest( ); + void getTypeChildrenTest( ); + void getObjectTest( ); + void getDocumentTest( ); + void getDocumentRelationshipsTest( ); + void getUnexistantObjectTest( ); + void getFolderTest( ); + void getFolderBadTypeTest( ); + void getByPathValidTest( ); + void getByPathInvalidTest( ); + void getRenditionsTest( ); + void getAllowableActionsTest( ); + void getAllowableActionsNotIncludedTest( ); + void getChildrenTest( ); + void getDocumentParentsTest( ); + void getContentStreamTest( ); + void setContentStreamTest( ); + void updatePropertiesTest( ); + void updatePropertiesEmptyTest( ); + void createFolderTest( ); + void createFolderBadTypeTest( ); + void createDocumentTest( ); + void deleteDocumentTest( ); + void deleteFolderTreeTest( ); + void checkOutTest( ); + void cancelCheckOutTest( ); + void checkInTest( ); + void getAllVersionsTest( ); + void moveTest( ); + + CPPUNIT_TEST_SUITE( AtomTest ); + CPPUNIT_TEST( sessionCreationTest ); + CPPUNIT_TEST( sessionCreationBadAuthTest ); + CPPUNIT_TEST( sessionCreationProxyTest ); + CPPUNIT_TEST( authCallbackTest ); + CPPUNIT_TEST( invalidSSLTest ); + CPPUNIT_TEST( getRepositoriesTest ); + CPPUNIT_TEST( getTypeTest ); + CPPUNIT_TEST( getUnexistantTypeTest ); + CPPUNIT_TEST( getTypeParentsTest ); + CPPUNIT_TEST( getTypeChildrenTest ); + CPPUNIT_TEST( getObjectTest ); + CPPUNIT_TEST( getDocumentTest ); + CPPUNIT_TEST( getDocumentRelationshipsTest ); + CPPUNIT_TEST( getUnexistantObjectTest ); + CPPUNIT_TEST( getFolderTest ); + CPPUNIT_TEST( getFolderBadTypeTest ); + CPPUNIT_TEST( getByPathValidTest ); + CPPUNIT_TEST( getByPathInvalidTest ); + CPPUNIT_TEST( getRenditionsTest ); + CPPUNIT_TEST( getAllowableActionsTest ); + CPPUNIT_TEST( getAllowableActionsNotIncludedTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( getDocumentParentsTest ); + CPPUNIT_TEST( getContentStreamTest ); + CPPUNIT_TEST( setContentStreamTest ); + CPPUNIT_TEST( updatePropertiesTest ); + CPPUNIT_TEST( updatePropertiesEmptyTest ); + CPPUNIT_TEST( createFolderTest ); + CPPUNIT_TEST( createFolderBadTypeTest ); + CPPUNIT_TEST( createDocumentTest ); + CPPUNIT_TEST( deleteDocumentTest ); + CPPUNIT_TEST( deleteFolderTreeTest ); + CPPUNIT_TEST( checkOutTest ); + CPPUNIT_TEST( cancelCheckOutTest ); + CPPUNIT_TEST( checkInTest ); + CPPUNIT_TEST( getAllVersionsTest ); + CPPUNIT_TEST( moveTest ); + CPPUNIT_TEST_SUITE_END( ); + + AtomPubSessionPtr getTestSession( string username = string( ), string password = string( ) ); +}; + +class TestAuthProvider : public libcmis::AuthProvider +{ + bool m_fail; + + public: + TestAuthProvider( bool fail ) : m_fail( fail ) { } + + bool authenticationQuery( std::string&, std::string& password ) + { + password = SERVER_PASSWORD; + return !m_fail; + } +}; + +class TestCertValidationHandler : public libcmis::CertValidationHandler +{ + public: + + bool m_fail; + vector< string > m_chain; + + TestCertValidationHandler( bool fail ) : m_fail( fail ), m_chain() { } + + bool validateCertificate( vector< string > chain ) + { + m_chain = chain; + return !m_fail; + } +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( AtomTest ); + +void AtomTest::sessionCreationTest( ) +{ + // Response showing one mock repository + curl_mockup_reset( ); + curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); + + // Check for the mandatory collection URLs + CPPUNIT_ASSERT_MESSAGE( "root collection URL missing", + !session.getAtomRepository()->getCollectionUrl( Collection::Root ).empty() ); + CPPUNIT_ASSERT_MESSAGE( "types collection URL missing", + !session.getAtomRepository()->getCollectionUrl( Collection::Types ).empty() ); + CPPUNIT_ASSERT_MESSAGE( "query collection URL missing", + !session.getAtomRepository()->getCollectionUrl( Collection::Query ).empty() ); + + // The optional collection URLs are present on InMemory, so check them + CPPUNIT_ASSERT_MESSAGE( "checkedout collection URL missing", + !session.getAtomRepository()->getCollectionUrl( Collection::CheckedOut ).empty() ); + CPPUNIT_ASSERT_MESSAGE( "unfiled collection URL missing", + !session.getAtomRepository()->getCollectionUrl( Collection::Unfiled ).empty() ); + + // Check for the mandatory URI template URLs + CPPUNIT_ASSERT_MESSAGE( "objectbyid URI template URL missing", + !session.getAtomRepository()->getUriTemplate( UriTemplate::ObjectById ).empty() ); + CPPUNIT_ASSERT_MESSAGE( "objectbypath URI template URL missing", + !session.getAtomRepository()->getUriTemplate( UriTemplate::ObjectByPath ).empty() ); + CPPUNIT_ASSERT_MESSAGE( "typebyid URI template URL missing", + !session.getAtomRepository()->getUriTemplate( UriTemplate::TypeById ).empty() ); + + // The optional URI template URL is present on InMemory, so check it + CPPUNIT_ASSERT_MESSAGE( "query URI template URL missing", + !session.getAtomRepository()->getUriTemplate( UriTemplate::Query ).empty() ); + + // Check that the root id is defined + CPPUNIT_ASSERT_MESSAGE( "Root node ID is missing", + !session.getRootId().empty() ); +} + +void AtomTest::sessionCreationBadAuthTest( ) +{ + // Response showing one mock repository + curl_mockup_reset( ); + curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + try + { + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, "bad", "bad" ); + CPPUNIT_FAIL( "Exception should have been thrown" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "permissionDenied" ), e.getType( ) ); + } +} + +void AtomTest::sessionCreationProxyTest( ) +{ + // Response showing one mock repository + curl_mockup_reset( ); + curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + string proxy( "proxy" ); + string noProxy( "noProxy" ); + string proxyUser( "proxyUser" ); + string proxyPass( "proxyPass" ); + + libcmis::SessionFactory::setProxySettings( proxy, noProxy, proxyUser, proxyPass ); + + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Proxy not set", proxy, string( curl_mockup_getProxy( session.m_curlHandle ) ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "NoProxy not set", noProxy, string( curl_mockup_getNoProxy( session.m_curlHandle ) ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Proxy User not set", proxyUser, string( curl_mockup_getProxyUser( session.m_curlHandle ) ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Proxy Pass not set", proxyPass, string( curl_mockup_getProxyPass( session.m_curlHandle ) ) ); + + // Reset proxy settings to default for next tests + libcmis::SessionFactory::setProxySettings( string(), string(), string(), string() ); +} + +void AtomTest::authCallbackTest( ) +{ + // Response showing one mock repository + curl_mockup_reset( ); + curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + + // Test cancelled authentication + { + libcmis::AuthProviderPtr authProvider( new TestAuthProvider( true ) ); + libcmis::SessionFactory::setAuthenticationProvider( authProvider ); + try + { + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, string( ) ); + CPPUNIT_FAIL( "Should raise an exception saying the user cancelled the authentication" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", + string( "User cancelled authentication request" ), string( e.what() ) ); + } + } + + // Test provided authentication + { + libcmis::AuthProviderPtr authProvider( new TestAuthProvider( false ) ); + libcmis::SessionFactory::setAuthenticationProvider( authProvider ); + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, string( ) ); + } +} + +void AtomTest::invalidSSLTest( ) +{ + // Response showing one mock repository + curl_mockup_reset( ); + curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + string badCert( "A really invalid SSL Certificate" ); + curl_mockup_setSSLBadCertificate( badCert.c_str() ); + + // Test validated certificate case + { + libcmis::CertValidationHandlerPtr handler( new TestCertValidationHandler( false ) ); + libcmis::SessionFactory::setCertificateValidationHandler( handler ); + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); + + TestCertValidationHandler* handler_impl = static_cast< TestCertValidationHandler* >( handler.get( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of certificates provided", size_t( 1 ), handler_impl->m_chain.size( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad certificate provided", badCert, handler_impl->m_chain.front() ); + } + + // Test cancelled validation case + { + libcmis::CertValidationHandlerPtr handler( new TestCertValidationHandler( true ) ); + libcmis::SessionFactory::setCertificateValidationHandler( handler ); + try + { + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); + CPPUNIT_FAIL( "Should raise an exception saying the user didn't validate the SSL certificate" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", + string( "Invalid SSL certificate" ), string( e.what() ) ); + } + } +} + +void AtomTest::getRepositoriesTest( ) +{ + // Response showing one mock repository + curl_mockup_reset( ); + curl_mockup_setResponse( DATA_DIR "/atom/workspaces.xml" ); + + AtomPubSession session( SERVER_URL, SERVER_REPOSITORY, SERVER_USERNAME, SERVER_PASSWORD ); + vector< libcmis::RepositoryPtr > actual = session.getRepositories( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), actual.size( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong repository found", SERVER_REPOSITORY, actual.front()->getId( ) ); +} + +void AtomTest::getTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "cmis:folder" ); + libcmis::ObjectTypePtr actual = session->getType( expectedId ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched type", expectedId, actual->getId( ) ); +} + +void AtomTest::getUnexistantTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "bad_type" ); + try + { + session->getType( expectedId ); + CPPUNIT_FAIL( "Exception should be raised: invalid ID" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "No such type: bad_type" ), string( e.what() ) ); + } +} + +void AtomTest::getTypeParentsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel1", "GET", DATA_DIR "/atom/type-docLevel1.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectTypePtr actual = session->getType( "DocumentLevel2" ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Parent type", string( "DocumentLevel1" ), actual->getParentType( )->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Base type", string( "cmis:document" ), actual->getBaseType( )->getId( ) ); +} + +void AtomTest::getTypeChildrenTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel1", "GET", DATA_DIR "/atom/type-docLevel1.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/types", "typeId=cmis:document", "GET", DATA_DIR "/atom/typechildren-document.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectTypePtr actual = session->getType( "cmis:document" ); + vector< libcmis::ObjectTypePtr > children = actual->getChildren( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 1 ), children.size( ) ); +} + +void AtomTest::getObjectTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "valid-object" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched object", expectedId, actual->getId( ) ); +} + +void AtomTest::getDocumentTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "test-document" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + // Do we have a document? + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( actual ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); + + // Test the document properties + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", expectedId, document->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "Test Document" ), document->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "text/plain" ), document->getContentType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !document->getChangeToken( ).empty( ) ); + + CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) ); +} + +void AtomTest::getDocumentRelationshipsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document-relationships.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "test-document" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + // Do we have a document? + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( actual ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); + + // Test the document properties + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", expectedId, document->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "Test Document" ), document->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "text/plain" ), document->getContentType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !document->getChangeToken( ).empty( ) ); + + CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) ); +} + +void AtomTest::getFolderTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "valid-object" ); + libcmis::FolderPtr actual = session->getFolder( expectedId ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", expectedId, actual->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "Valid Object" ), actual->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder path", string( "/Valid Object" ), actual->getPath( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder paths", + string( "/Valid Object" ), actual->getPaths( )[0] ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Folder should have only one path", + size_t(1), actual->getPaths( ).size() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), actual->getBaseType( ) ); + CPPUNIT_ASSERT_MESSAGE( "Missing folder parent", actual->getFolderParent( ).get( ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !actual->isRootFolder() ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !actual->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !actual->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !actual->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !actual->getLastModificationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !actual->getChangeToken( ).empty( ) ); +} + +void AtomTest::getFolderBadTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::FolderPtr actual = session->getFolder( "test-document" ); + + CPPUNIT_ASSERT_MESSAGE( "returned folder should be an empty pointer", NULL == actual ); +} + +void AtomTest::getUnexistantObjectTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string id( "bad_object" ); + try + { + session->getObject( id ); + CPPUNIT_FAIL( "Exception should be raised: invalid ID" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong CMIS exception type", string( "objectNotFound" ), e.getType() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", string( "No such node: " ) + id, string( e.what() ) ); + } +} + +void AtomTest::getByPathValidTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/path", "path=/Valid Object", "GET", DATA_DIR "/atom/valid-object.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr actual = session->getObjectByPath( string( "/Valid Object" ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched object", string( "valid-object" ), actual->getId( ) ); +} + +void AtomTest::getByPathInvalidTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + try + { + session->getObjectByPath( string( "/some/invalid/path" ) ); + CPPUNIT_FAIL( "Exception should be thrown: invalid Path" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception message", + string( "No node corresponding to path: /some/invalid/path" ), string( e.what() ) ); + } + +} + +void AtomTest::getRenditionsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "test-document" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + std::vector< libcmis::RenditionPtr > renditions = actual->getRenditions( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad renditions count", size_t( 2 ), renditions.size( ) ); + + libcmis::RenditionPtr rendition = renditions[0]; + CPPUNIT_ASSERT( rendition->isThumbnail() ); + + rendition = renditions[1]; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition mime type", string( "application/pdf" ), rendition->getMimeType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition href", string( "http://mockup/mock/renditions?id=test-document-rendition2" ), rendition->getUrl() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition length - default case", long( -1 ), rendition->getLength( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition Title", string( "Doc as PDF" ), rendition->getTitle( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition kind", string( "pdf" ), rendition->getKind( ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition length - filled case", long( 40385 ), renditions[0]->getLength( ) ); +} + +void AtomTest::getAllowableActionsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "valid-object" ); + libcmis::FolderPtr actual = session->getFolder( expectedId ); + + boost::shared_ptr< libcmis::AllowableActions > toCheck = actual->getAllowableActions( ); + CPPUNIT_ASSERT_MESSAGE( "ApplyACL allowable action not defined... are all the actions read?", + toCheck->isDefined( libcmis::ObjectAction::ApplyACL ) ); + + CPPUNIT_ASSERT_MESSAGE( "GetChildren allowable action should be true", + toCheck->isDefined( libcmis::ObjectAction::GetChildren ) && + toCheck->isAllowed( libcmis::ObjectAction::GetChildren ) ); +} + +void AtomTest::getAllowableActionsNotIncludedTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object-noactions.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/allowableactions", "id=valid-object", "GET", DATA_DIR "/atom/allowable-actions.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + string expectedId( "valid-object" ); + libcmis::FolderPtr actual = session->getFolder( expectedId ); + + // In some cases (mostly when getting folder children), we may not have the allowable actions + // included in the object answer. Test that we are querying them when needed in those cases. + boost::shared_ptr< libcmis::AllowableActions > toCheck = actual->getAllowableActions( ); + CPPUNIT_ASSERT_MESSAGE( "ApplyACL allowable action not defined... are all the actions read?", + toCheck->isDefined( libcmis::ObjectAction::ApplyACL ) ); + + CPPUNIT_ASSERT_MESSAGE( "GetChildren allowable action should be true", + toCheck->isDefined( libcmis::ObjectAction::GetChildren ) && + toCheck->isAllowed( libcmis::ObjectAction::GetChildren ) ); +} + +void AtomTest::getChildrenTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "GET", DATA_DIR "/atom/root-children.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + vector< libcmis::ObjectPtr > children = session->getRootFolder()->getChildren( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 5 ), children.size() ); + + int folderCount = 0; + int documentCount = 0; + for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); + it != children.end( ); ++it ) + { + if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) + ++folderCount; + else if ( NULL != boost::dynamic_pointer_cast< libcmis::Document >( *it ) ) + ++documentCount; + } + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 2, folderCount ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of document children", 3, documentCount ); +} + +void AtomTest::getDocumentParentsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/parents", "id=test-document", "GET", DATA_DIR "/atom/test-document-parents.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); + vector< libcmis::FolderPtr > actual = document->getParents( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 2 ), actual.size() ); + + vector< string > paths = document->getPaths(); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of paths", size_t( 2 ), paths.size() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad document paths", + string( "/Parent 1/Test Document" ), paths[0] ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad document paths", + string( "/Parent 2/Test Document" ), paths[1] ); +} + +void AtomTest::getContentStreamTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + + string expectedContent( "Some content stream" ); + curl_mockup_addResponse( "http://mockup/mock/content/data.txt", "id=test-document", "GET", expectedContent.c_str( ), 0, false ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + try + { + boost::shared_ptr< istream > is = document->getContentStream( ); + ostringstream out; + out << is->rdbuf(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", expectedContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void AtomTest::setContentStreamTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/content/data.txt", "id=test-document", "PUT", "Updated", 0, false ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + try + { + string expectedContent( "Some content stream to set" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "name.txt" ); + document->setContentStream( os, "text/plain", filename ); + + CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); + + // Check the content has been properly uploaded + const char* content = curl_mockup_getRequestBody( "http://mockup/mock/content/", "id=test-document", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void AtomTest::updatePropertiesTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "PUT", DATA_DIR "/atom/test-document-updated.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + // Values for the test + libcmis::ObjectPtr object = session->getObject( "test-document" ); + string propertyName( "cmis:name" ); + string expectedValue( "New name" ); + + // Fill the map of properties to change + PropertyPtrMap newProperties; + + libcmis::ObjectTypePtr objectType = object->getTypeDescription( ); + map< string, libcmis::PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( propertyName ); + vector< string > values; + values.push_back( expectedValue ); + libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); + newProperties[ propertyName ] = property; + + // Update the properties (method to test) + libcmis::ObjectPtr updated = object->updateProperties( newProperties ); + + // Check that the proper request has been send + // In order to avoid to check changing strings (containing a timestamp), + // get the cmisra:object tree and compare it. + string request( curl_mockup_getRequestBody( "http://mockup/mock/id", "id=test-document", "PUT" ) ); + string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); + + string expectedObject = "<cmisra:object>" + "<cmis:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>New name</cmis:value>" + "</cmis:propertyString>" + "</cmis:properties>" + "</cmisra:object>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedObject, actualObject ); + + // Check that the properties are updated after the call + PropertyPtrMap::iterator propIt = updated->getProperties( ).find( propertyName ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong value after refresh", expectedValue, propIt->second->getStrings().front( ) ); +} + +void AtomTest::updatePropertiesEmptyTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + // Values for the test + libcmis::ObjectPtr object = session->getObject( "test-document" ); + + // Just leave the map empty and update + PropertyPtrMap emptyProperties; + libcmis::ObjectPtr updated = object->updateProperties( emptyProperties ); + + // Check that no HTTP request was sent + int count = curl_mockup_getRequestsCount( "http://mockup/mock/id", + "id=test-document", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "No HTTP request should have been sent", 0, count ); + + // Check that the object we got is the same than previous one + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong change token", object->getChangeToken(), updated->getChangeToken() ); +} + +void AtomTest::createFolderTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "POST", DATA_DIR "/atom/create-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "cmis:folder" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + string expectedName( "create folder" ); + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( expectedName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "cmis:folder" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Actually send the folder creation request + libcmis::FolderPtr created = parent->createFolder( props ); + + // Check that something came back + CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", + !created->getChangeToken( ).empty() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong name", expectedName, created->getName( ) ); + + // Check that the proper request has been sent + string request( curl_mockup_getRequestBody( "http://mockup/mock/children", "id=root-folder", "POST" ) ); + string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); + + string expectedObject = "<cmisra:object>" + "<cmis:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>create folder</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\" localName=\"cmis:objectTypeId\"" + " displayName=\"Type-Id\" queryName=\"cmis:objectTypeId\">" + "<cmis:value>cmis:folder</cmis:value>" + "</cmis:propertyId>" + "</cmis:properties>" + "</cmisra:object>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedObject, actualObject ); +} + +void AtomTest::createFolderBadTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "POST", + "Not a cmis:folder derived type", 409, false ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "cmis:folder" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + string expectedName( "create folder" ); + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( expectedName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "cmis:document" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Actually send the folder creation request + try + { + parent->createFolder( props ); + CPPUNIT_FAIL( "Should not succeed to return a folder" ); + } + catch ( libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "constraint" ), e.getType() ); + } + + // Check that the proper request has been sent + string request( curl_mockup_getRequestBody( "http://mockup/mock/children", "id=root-folder", "POST" ) ); + string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); + + string expectedObject = "<cmisra:object>" + "<cmis:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>create folder</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\" localName=\"cmis:objectTypeId\"" + " displayName=\"Type-Id\" queryName=\"cmis:objectTypeId\">" + "<cmis:value>cmis:document</cmis:value>" + "</cmis:propertyId>" + "</cmis:properties>" + "</cmisra:object>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedObject, actualObject ); +} + +void AtomTest::createDocumentTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/children", "id=root-folder", "POST", "Response body up to server", 201, false, + "Location: http://mockup/mock/id?id=create-document\r\n" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=create-document", "GET", DATA_DIR "/atom/create-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=root-folder", "GET", DATA_DIR "/atom/root-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:document", "GET", DATA_DIR "/atom/type-document.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "cmis:document" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + string expectedName( "create document" ); + + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( expectedName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "cmis:document" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Actually send the document creation request + string content = "Some content"; + boost::shared_ptr< ostream > os ( new stringstream( content ) ); + string contentType = "text/plain"; + string filename( "name.txt" ); + libcmis::DocumentPtr created = parent->createDocument( props, os, contentType, filename ); + + // Check that something came back + CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", + !created->getChangeToken( ).empty() ); + + // Check that the name is ok + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong name set", expectedName, created->getName( ) ); + + // Check that the request is the expected one + string request( curl_mockup_getRequestBody( "http://mockup/mock/children", "id=root-folder", "POST" ) ); + string actualContent = test::getXmlNodeAsString( request, "/atom:entry/cmisra:content" ); + string expectedContent = "<cmisra:content>" + "<cmisra:mediatype>text/plain</cmisra:mediatype>" + "<cmisra:base64>U29tZSBjb250ZW50</cmisra:base64>" + "</cmisra:content>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request content sent", expectedContent, actualContent ); + + string actualObject = test::getXmlNodeAsString( request, "/atom:entry/cmisra:object" ); + string expectedObject = "<cmisra:object>" + "<cmis:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>create document</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\" localName=\"cmis:objectTypeId\"" + " displayName=\"Type-Id\" queryName=\"cmis:objectTypeId\">" + "<cmis:value>cmis:document</cmis:value>" + "</cmis:propertyId>" + "</cmis:properties>" + "</cmisra:object>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request object sent", expectedObject, actualObject ); +} + +void AtomTest::deleteDocumentTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "DELETE", "", 204, false ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); + + document->remove( ); + + // Test the sent request + const char* request = curl_mockup_getRequestBody( "http://mockup/mock/id", "id=test-document", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "DELETE request not sent", request ); +} + +void AtomTest::deleteFolderTreeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); + curl_mockup_addResponse( "http://mockup/mock/descendants", "id=valid-object", "DELETE", "", 204, false ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "valid-object" ); + libcmis::Folder* folder = dynamic_cast< libcmis::Folder* >( object.get() ); + + folder->removeTree( ); + + // Test the sent request + const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/descendants", "id=valid-object", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "DELETE request not sent", request ); + curl_mockup_HttpRequest_free( request ); +} + +void AtomTest::checkOutTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/checkedout", "", "POST", DATA_DIR "/atom/working-copy.xml", 201 ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); + + libcmis::DocumentPtr pwc = document->checkOut( ); + + CPPUNIT_ASSERT_MESSAGE( "Missing returned Private Working Copy", pwc.get( ) != NULL ); + + PropertyPtrMap::iterator it = pwc->getProperties( ).find( string( "cmis:isVersionSeriesCheckedOut" ) ); + vector< bool > values = it->second->getBools( ); + CPPUNIT_ASSERT_MESSAGE( "cmis:isVersionSeriesCheckedOut isn't true", values.front( ) ); +} + +void AtomTest::cancelCheckOutTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "GET", DATA_DIR "/atom/working-copy.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "DELETE", "", 204, false ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + // First get a checked out document + libcmis::ObjectPtr object = session->getObject( "working-copy" ); + libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + pwc->cancelCheckout( ); + + // Check that the DELETE request was sent out + const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/id", "id=working-copy", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "DELETE request not sent", request ); + curl_mockup_HttpRequest_free( request ); +} + +void AtomTest::checkInTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "GET", DATA_DIR "/atom/working-copy.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=working-copy", "PUT", DATA_DIR "/atom/test-document.xml", 200, true, + "Location: http://mockup/mock/id?id=valid-object" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + // First get a checked out document + libcmis::ObjectPtr object = session->getObject( "working-copy" ); + libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + // Do the checkin + bool isMajor = true; + string comment( "Some check-in comment" ); + PropertyPtrMap properties; + string newContent = "Some New content to check in"; + boost::shared_ptr< ostream > stream ( new stringstream( newContent ) ); + pwc->checkIn( isMajor, comment, properties, stream, "text/plain", "filename.txt" ); + + // Make sure that the expected request has been sent + const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/id", "id=working-copy", "PUT" ); + CPPUNIT_ASSERT_MESSAGE( "PUT request not sent", request ); + + string actualContent = test::getXmlNodeAsString( request->body, "/atom:entry/cmisra:content" ); + string expectedContent = "<cmisra:content><cmisra:mediatype>text/plain</cmisra:mediatype><cmisra:base64>U29tZSBOZXcgY29udGVudCB0byBjaGVjayBpbg==</cmisra:base64></cmisra:content>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content sent", expectedContent, actualContent ); + + // Still needs to test that checkin request parameters were OK + string url( request->url ); + CPPUNIT_ASSERT_MESSAGE( "Sent checkin request has wrong major parameter", url.find("major=true") != string::npos ); + CPPUNIT_ASSERT_MESSAGE( "Sent checkin request has wrong checkinComment parameter", url.find( "checkinComment=" + comment ) != string::npos ); + CPPUNIT_ASSERT_MESSAGE( "Sent checkin request has no checkin parameter", url.find("checkin=true") != string::npos ); + + curl_mockup_HttpRequest_free( request ); +} + +void AtomTest::getAllVersionsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/versions", "id=test-document", "GET", DATA_DIR "/atom/get-versions.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + // First get a document + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::DocumentPtr doc = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + // Get all the versions (method to check) + vector< libcmis::DocumentPtr > versions = doc->getAllVersions( ); + + // Checks + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of versions", size_t( 2 ), versions.size( ) ); +} + +void AtomTest::moveTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_addResponse( "http://mockup/mock/parents", "id=test-document", "GET", DATA_DIR "/atom/test-document-parents.xml" ); + curl_mockup_addResponse( "http://mockup/mock/id", "id=valid-object", "GET", DATA_DIR "/atom/valid-object.xml" ); + curl_mockup_addResponse( "http://mockup/mock/type", "id=cmis:folder", "GET", DATA_DIR "/atom/type-folder.xml" ); + curl_mockup_addResponse( "http://mockup/mock/children", "id=valid-object", "POST", DATA_DIR "/atom/test-document.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + AtomPubSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); + + libcmis::ObjectPtr object = session->getObject( "test-document" ); + libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); + + string destFolderId = "valid-object"; + libcmis::FolderPtr src = document->getParents( ).front( ); + libcmis::FolderPtr dest = session->getFolder( destFolderId ); + + document->move( src, dest ); + + // Check that the sent request has the expected params + const struct HttpRequest* request = curl_mockup_getRequest( "http://mockup/mock/children", "id=valid-object", "POST" ); + string url( request->url ); + CPPUNIT_ASSERT_MESSAGE( "Sent move request has wrong or missing sourceFolderId", url.find("sourceFolderId=parent1") != string::npos ); + + // Check that we had the atom entry in the request body + string actualObject = test::getXmlNodeAsString( request->body, "/atom:entry/cmisra:object/cmis:properties/cmis:propertyId[@propertyDefinitionId='cmis:objectId']" ); + string expectedObject = "<cmis:propertyId propertyDefinitionId=\"cmis:objectId\" localName=\"cmis:objectId\"" + " displayName=\"Object Id\" queryName=\"cmis:objectId\">" + "<cmis:value>test-document</cmis:value>" + "</cmis:propertyId>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request object sent", expectedObject, actualObject ); + + curl_mockup_HttpRequest_free( request ); +} + +AtomPubSessionPtr AtomTest::getTestSession( string username, string password ) +{ + AtomPubSessionPtr session( new AtomPubSession( ) ); + string buf; + test::loadFromFile( DATA_DIR "/atom/workspaces.xml", buf ); + session->parseServiceDocument( buf ); + + session->m_username = username; + session->m_password = password; + + return session; +} diff --git a/qa/libcmis/test-commons.cxx b/qa/libcmis/test-commons.cxx new file mode 100644 index 0000000..df271e9 --- /dev/null +++ b/qa/libcmis/test-commons.cxx @@ -0,0 +1,223 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2014 SUSE <cedric@bosdonnat.fr> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <time.h> + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> +#include <cppunit/ui/text/TestRunner.h> +#include <libxml/tree.h> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <libcmis/oauth2-data.hxx> +#include <libcmis/object-type.hxx> + +#include "oauth2-handler.hxx" + +using namespace libcmis; +using namespace std; + +class CommonsTest : public CppUnit::TestFixture +{ + public: + + // constructors tests + void oauth2DataCopyTest(); + void oauth2HandlerCopyTest(); + void objectTypeCopyTest(); + + // Methods that should never be called + void objectTypeNocallTest(); + + CPPUNIT_TEST_SUITE( CommonsTest ); + CPPUNIT_TEST( oauth2DataCopyTest ); + CPPUNIT_TEST( oauth2HandlerCopyTest ); + CPPUNIT_TEST( objectTypeCopyTest ); + CPPUNIT_TEST( objectTypeNocallTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +static void assertOAuth2DataEquals( const OAuth2Data& expected, const OAuth2Data& actual ) +{ + CPPUNIT_ASSERT_EQUAL( expected.m_authUrl, actual.m_authUrl ); + CPPUNIT_ASSERT_EQUAL( expected.m_tokenUrl, actual.m_tokenUrl ); + CPPUNIT_ASSERT_EQUAL( expected.m_scope, actual.m_scope ); + CPPUNIT_ASSERT_EQUAL( expected.m_redirectUri, actual.m_redirectUri ); + CPPUNIT_ASSERT_EQUAL( expected.m_clientId, actual.m_clientId ); + CPPUNIT_ASSERT_EQUAL( expected.m_clientSecret, actual.m_clientSecret ); +} + +void CommonsTest::oauth2DataCopyTest( ) +{ + OAuth2Data data( "url", "token", "scope", "redirect", + "clientid", "clientsecret" ); + { + OAuth2Data copy; + copy = data; + assertOAuth2DataEquals( data, copy ); + } + + { + OAuth2Data copy( data ); + assertOAuth2DataEquals( data, copy ); + } +} + +string DummyOAuth2Parser( HttpSession*, const string&, const string&, const string& ) +{ + return "Fake"; +} + +void CommonsTest::oauth2HandlerCopyTest( ) +{ + OAuth2DataPtr data( new OAuth2Data ( "url", "token", "scope", "redirect", + "clientid", "clientsecret" ) ); + HttpSession session( "user", "pass" ); + OAuth2Handler handler( &session, data ); + handler.m_access = "access"; + handler.m_refresh = "refresh"; + handler.m_oauth2Parser = &DummyOAuth2Parser; + + { + OAuth2Handler copy; + copy = handler; + + CPPUNIT_ASSERT_EQUAL( &session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL( data, copy.m_data ); + CPPUNIT_ASSERT_EQUAL( handler.m_access, copy.m_access ); + CPPUNIT_ASSERT_EQUAL( handler.m_refresh, copy.m_refresh ); + CPPUNIT_ASSERT_EQUAL( &DummyOAuth2Parser, copy.m_oauth2Parser ); + } + + { + OAuth2Handler copy( handler ); + + CPPUNIT_ASSERT_EQUAL( &session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL( data, copy.m_data ); + CPPUNIT_ASSERT_EQUAL( handler.m_access, copy.m_access ); + CPPUNIT_ASSERT_EQUAL( handler.m_refresh, copy.m_refresh ); + CPPUNIT_ASSERT_EQUAL( &DummyOAuth2Parser, copy.m_oauth2Parser ); + } +} + +static void assertObjectTypeEquals( const ObjectType& expected, const ObjectType& actual ) +{ + CPPUNIT_ASSERT_EQUAL( expected.getRefreshTimestamp(), actual.getRefreshTimestamp() ); + CPPUNIT_ASSERT_EQUAL( expected.getId(), actual.getId() ); + CPPUNIT_ASSERT_EQUAL( expected.getLocalName(), actual.getLocalName() ); + CPPUNIT_ASSERT_EQUAL( expected.getLocalNamespace(), actual.getLocalNamespace() ); + CPPUNIT_ASSERT_EQUAL( expected.getDisplayName(), actual.getDisplayName() ); + CPPUNIT_ASSERT_EQUAL( expected.getQueryName(), actual.getQueryName() ); + CPPUNIT_ASSERT_EQUAL( expected.getDescription(), actual.getDescription() ); + CPPUNIT_ASSERT_EQUAL( expected.getParentTypeId(), actual.getParentTypeId() ); + CPPUNIT_ASSERT_EQUAL( expected.getBaseTypeId(), actual.getBaseTypeId() ); + CPPUNIT_ASSERT_EQUAL( expected.isCreatable(), actual.isCreatable() ); + CPPUNIT_ASSERT_EQUAL( expected.isFileable(), actual.isFileable() ); + CPPUNIT_ASSERT_EQUAL( expected.isQueryable(), actual.isQueryable() ); + CPPUNIT_ASSERT_EQUAL( expected.isFulltextIndexed(), actual.isFulltextIndexed() ); + CPPUNIT_ASSERT_EQUAL( expected.isIncludedInSupertypeQuery(), actual.isIncludedInSupertypeQuery() ); + CPPUNIT_ASSERT_EQUAL( expected.isControllablePolicy(), actual.isControllablePolicy() ); + CPPUNIT_ASSERT_EQUAL( expected.isControllableACL(), actual.isControllableACL() ); + CPPUNIT_ASSERT_EQUAL( expected.isVersionable(), actual.isVersionable() ); + CPPUNIT_ASSERT_EQUAL( expected.getContentStreamAllowed(), actual.getContentStreamAllowed() ); + CPPUNIT_ASSERT_EQUAL( const_cast< ObjectType& >( expected ).getPropertiesTypes().size(), + const_cast< ObjectType& >( actual ).getPropertiesTypes().size() ); +} + +void CommonsTest::objectTypeCopyTest( ) +{ + ObjectType type; + time_t refresh = time( NULL ); + type.m_refreshTimestamp = refresh; + type.m_id = "id"; + type.m_baseTypeId = "base"; + + { + ObjectType copy; + copy = type; + assertObjectTypeEquals( type, copy ); + } + + { + ObjectType copy ( type ); + assertObjectTypeEquals( type, copy ); + } +} + +void CommonsTest::objectTypeNocallTest( ) +{ + ObjectType type; + + try + { + type.refresh(); + CPPUNIT_FAIL( "refresh() shouldn't succeed" ); + } + catch ( const Exception& e ) + { + } + + try + { + type.getParentType(); + CPPUNIT_FAIL( "getParentType() shouldn't succeed" ); + } + catch ( const Exception& e ) + { + } + + try + { + type.getBaseType(); + CPPUNIT_FAIL( "getBaseType() shouldn't succeed" ); + } + catch ( const Exception& e ) + { + } + + try + { + type.getChildren(); + CPPUNIT_FAIL( "getChildren() shouldn't succeed" ); + } + catch ( const Exception& e ) + { + } +} + +CPPUNIT_TEST_SUITE_REGISTRATION( CommonsTest ); diff --git a/qa/libcmis/test-decoder.cxx b/qa/libcmis/test-decoder.cxx new file mode 100644 index 0000000..c7b4748 --- /dev/null +++ b/qa/libcmis/test-decoder.cxx @@ -0,0 +1,221 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> +#include <cppunit/ui/text/TestRunner.h> + +#include <libcmis/xml-utils.hxx> + +#define BASE64_ENCODING string( "base64" ) + +using namespace std; + +class DecoderTest : public CppUnit::TestFixture +{ + private: + libcmis::EncodedData* data; + FILE* stream; + + string getActual( ); + + public: + + DecoderTest( ); + DecoderTest( const DecoderTest& rCopy ); + + DecoderTest& operator=( const DecoderTest& rCopy ); + + void setUp( ); + void tearDown( ); + + void noEncodingTest(); + + void base64DecodeSimpleBlockTest( ); + void base64DecodePaddedBlockTest( ); + void base64DecodeNoEqualsPaddedBlockTest( ); + void base64DecodeSplitRunsTest( ); + + void base64EncodeSimpleBlockTest( ); + void base64EncodePaddedBlockTest( ); + void base64EncodeSplitRunsTest( ); + + void base64encodeTest( ); + + CPPUNIT_TEST_SUITE( DecoderTest ); + CPPUNIT_TEST( noEncodingTest ); + CPPUNIT_TEST( base64DecodeSimpleBlockTest ); + CPPUNIT_TEST( base64DecodePaddedBlockTest ); + CPPUNIT_TEST( base64DecodeNoEqualsPaddedBlockTest ); + CPPUNIT_TEST( base64DecodeSplitRunsTest ); + CPPUNIT_TEST( base64EncodeSimpleBlockTest ); + CPPUNIT_TEST( base64EncodePaddedBlockTest ); + CPPUNIT_TEST( base64EncodeSplitRunsTest ); + CPPUNIT_TEST( base64encodeTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +DecoderTest::DecoderTest( ) : + CppUnit::TestFixture( ), + data( NULL ), + stream( NULL ) +{ +} + +DecoderTest::DecoderTest( const DecoderTest& rCopy ) : + CppUnit::TestFixture( ), + data( rCopy.data ), + stream( rCopy.stream ) +{ +} + +DecoderTest& DecoderTest::operator=( const DecoderTest& rCopy ) +{ + if ( this != &rCopy ) + { + data = rCopy.data; + stream = rCopy.stream; + } + return *this; +} + +void DecoderTest::setUp( ) +{ + stream = tmpfile(); + data = new libcmis::EncodedData( stream ); +} + +void DecoderTest::tearDown( ) +{ + fclose( stream ); + delete data; +} + +string DecoderTest::getActual( ) +{ + string actual; + + rewind( stream ); + size_t bufSize = 100; + char buf[100]; + size_t readBytes = 0; + do { + readBytes = fread( buf, 1, bufSize, stream ); + actual += string( buf, readBytes ); + } while ( readBytes == bufSize ); + + return actual; +} + +void DecoderTest::noEncodingTest() +{ + data->decode( ( void* )"pleasure.", 1, 9 ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "pleasure." ), getActual( ) ); +} + +/* + * All the test values for the Base64 have been taken from + * the wikipedia article: http://en.wikipedia.org/wiki/Base64 + */ + +void DecoderTest::base64DecodeSimpleBlockTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input( "cGxlYXN1cmUu" ); + data->decode( ( void* )input.c_str( ), 1, input.size() ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "pleasure." ), getActual( ) ); +} + +void DecoderTest::base64DecodePaddedBlockTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input( "c3VyZS4=" ); + data->decode( ( void* )input.c_str( ), 1, input.size( ) ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "sure." ), getActual( ) ); +} + +void DecoderTest::base64DecodeNoEqualsPaddedBlockTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input( "c3VyZS4" ); + data->decode( ( void* )input.c_str( ), 1, input.size( ) ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "sure." ), getActual( ) ); +} + +void DecoderTest::base64DecodeSplitRunsTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input1( "cGxlYXN1c" ); + data->decode( ( void* )input1.c_str( ), 1, input1.size( ) ); + string input2( "mUu" ); + data->decode( ( void* )input2.c_str( ), 1, input2.size( ) ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "pleasure." ), getActual( ) ); +} + +void DecoderTest::base64EncodeSimpleBlockTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input( "pleasure." ); + data->encode( ( void* )input.c_str(), 1, input.size() ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "cGxlYXN1cmUu" ), getActual( ) ); +} + +void DecoderTest::base64EncodePaddedBlockTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input( "sure." ); + data->encode( ( void* )input.c_str(), 1, input.size() ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "c3VyZS4=" ), getActual( ) ); +} + +void DecoderTest::base64EncodeSplitRunsTest( ) +{ + data->setEncoding( BASE64_ENCODING ); + string input1( "plea" ); + data->encode( ( void* )input1.c_str(), 1, input1.size() ); + string input2( "sure." ); + data->encode( ( void* )input2.c_str(), 1, input2.size() ); + data->finish( ); + CPPUNIT_ASSERT_EQUAL( string( "cGxlYXN1cmUu" ), getActual( ) ); +} + +void DecoderTest::base64encodeTest( ) +{ + string actual = libcmis::base64encode( "sure." ); + CPPUNIT_ASSERT_EQUAL( string( "c3VyZS4=" ), actual ); +} + +CPPUNIT_TEST_SUITE_REGISTRATION( DecoderTest ); diff --git a/qa/libcmis/test-factory.cxx b/qa/libcmis/test-factory.cxx new file mode 100644 index 0000000..74a6b02 --- /dev/null +++ b/qa/libcmis/test-factory.cxx @@ -0,0 +1,336 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <memory> + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <libcmis/session-factory.hxx> + +#include <atom-session.hxx> +#include <ws-session.hxx> +#include <gdrive-session.hxx> +#include <onedrive-session.hxx> +#include <sharepoint-session.hxx> + +#include <mockup-config.h> +#include <test-helpers.hxx> +#include <test-mockup-helpers.hxx> + +#define BINDING_ATOM string( "http://mockup/atom" ) +#define BINDING_WS string( "http://mockup/ws" ) +#define BINDING_SHAREPOINT string ( "http://mockup/sharepoint/_api/web" ) +#define CONTEXTINFO_URL string ( "http://mockup/sharepoint/_api/contextinfo" ) +#define BINDING_BAD "http://mockup/bad" +#define BINDING_GDRIVE string ( "https://www.googleapis.com/drive/v3" ) +#define BINDING_ONEDRIVE string ( "https://graph.microsoft.com/v1.0" ) +#define SERVER_REPOSITORY string( "mock" ) +#define SERVER_USERNAME "tester" +#define SERVER_PASSWORD "somepass" + +#define OAUTH_CLIENT_ID string ( "mock-id" ) +#define OAUTH_CLIENT_SECRET string ( "mock-secret" ) +#define OAUTH_SCOPE string ( "https://scope/url" ) +#define OAUTH_REDIRECT_URI string ("redirect:uri" ) + +#define GDRIVE_AUTH_URL string ( "https://auth/url" ) +#define GDRIVE_LOGIN_URL string ("https://login/url" ) +#define GDRIVE_LOGIN_URL2 string ("https://login2/url" ) +#define GDRIVE_APPROVAL_URL string ("https://approval/url" ) +#define GDRIVE_TOKEN_URL string ( "https://token/url" ) + +#define ONEDRIVE_AUTH_URL string ( "https://auth/url" ) +#define ONEDRIVE_TOKEN_URL string ( "https://token/url" ) + +using namespace std; + +namespace +{ + void lcl_init_mockup_ws( ) + { + curl_mockup_reset( ); + curl_mockup_addResponse( BINDING_WS.c_str( ), "", "GET", + DATA_DIR "/ws/CMISWS-Service.wsdl" ); + test::addWsResponse( string( BINDING_WS + "/services/RepositoryService" ).c_str(), + DATA_DIR "/ws/repositories.http" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + } + + void lcl_init_mockup_atom( ) + { + curl_mockup_reset( ); + curl_mockup_addResponse( BINDING_ATOM.c_str( ), "", "GET", + DATA_DIR "/atom/workspaces.xml" ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + } + + void lcl_init_mockup_gdrive( ) + { + curl_mockup_reset( ); + + //login response + string loginIdentifier = string("scope=") + OAUTH_SCOPE + + string("&redirect_uri=") + OAUTH_REDIRECT_URI + + string("&response_type=code") + + string("&client_id=") + OAUTH_CLIENT_ID; + + curl_mockup_addResponse ( GDRIVE_AUTH_URL.c_str(), loginIdentifier.c_str( ), + "GET", DATA_DIR "/gdrive/login1.html", 200, true); + + //authentication email + curl_mockup_addResponse( GDRIVE_LOGIN_URL2.c_str( ), "", "POST", + DATA_DIR "/gdrive/login2.html", 200, true); + + //authentication password, + curl_mockup_addResponse( GDRIVE_LOGIN_URL.c_str( ), "", "POST", + DATA_DIR "/gdrive/approve.html", 200, true); + + //approval response + curl_mockup_addResponse( GDRIVE_APPROVAL_URL.c_str( ), "", + "POST", DATA_DIR "/gdrive/authcode.html", 200, true); + + curl_mockup_addResponse ( GDRIVE_TOKEN_URL.c_str( ), "", "POST", + DATA_DIR "/gdrive/token-response.json", 200, true ); + } + + char* authCodeFallback( const char* /*url*/, const char* /*username*/, const char* /*password*/ ) + { + char *authCode = strdup( "authCode" ); + return authCode; + } + + void lcl_init_mockup_sharepoint( ) + { + curl_mockup_reset( ); + + curl_mockup_addResponse( BINDING_SHAREPOINT.c_str( ), "", "GET", "", 401, false ); + curl_mockup_addResponse( ( BINDING_SHAREPOINT + "/currentuser" ).c_str( ), "", "GET", + DATA_DIR "/sharepoint/auth-resp.json", 200, true ); + curl_mockup_addResponse( CONTEXTINFO_URL.c_str( ), "", "POST", + DATA_DIR "/sharepoint/xdigest.json", 200, true ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + } +} + +class FactoryTest : public CppUnit::TestFixture +{ + public: + + void createSessionAtomTest( ); + void createSessionAtomBadAuthTest( ); + void createSessionWSTest( ); + void createSessionWSBadAuthTest( ); + void createSessionNoCmisTest( ); + void createSessionGDriveTest( ); + void createSessionOneDriveTest( ); + void createSessionSharePointTest( ); + void createSessionSharePointDefaultAuthTest( ); + void createSessionSharePointBadAuthTest( ); + + CPPUNIT_TEST_SUITE( FactoryTest ); + CPPUNIT_TEST( createSessionAtomTest ); + CPPUNIT_TEST( createSessionAtomBadAuthTest ); + CPPUNIT_TEST( createSessionWSTest ); + CPPUNIT_TEST( createSessionWSBadAuthTest ); + CPPUNIT_TEST( createSessionNoCmisTest ); + CPPUNIT_TEST( createSessionGDriveTest ); + CPPUNIT_TEST( createSessionOneDriveTest ); + CPPUNIT_TEST( createSessionSharePointTest ); + CPPUNIT_TEST( createSessionSharePointDefaultAuthTest ); + CPPUNIT_TEST( createSessionSharePointBadAuthTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( FactoryTest ); + +void FactoryTest::createSessionAtomTest( ) +{ + lcl_init_mockup_atom( ); + + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_ATOM, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY ) ); + CPPUNIT_ASSERT_MESSAGE( "Not an AtomPubSession", + dynamic_cast< AtomPubSession* >( session.get() ) != NULL ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "More than one request for the binding", + int( 1 ), curl_mockup_getRequestsCount( BINDING_ATOM.c_str( ), "", "GET" ) ); +} + +void FactoryTest::createSessionAtomBadAuthTest( ) +{ + lcl_init_mockup_atom( ); + + try + { + libcmis::SessionFactory::createSession( + BINDING_ATOM, "Bad user", "Bad Password", + SERVER_REPOSITORY ); + CPPUNIT_FAIL( "Should throw exception" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", + string( "permissionDenied" ), e.getType( ) ); + } +} + +void FactoryTest::createSessionWSTest( ) +{ + lcl_init_mockup_ws( ); + + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_WS, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a WSSession", + dynamic_cast< WSSession* >( session.get() ) != NULL ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "More than one request for the binding", + int( 1 ), curl_mockup_getRequestsCount( BINDING_WS.c_str( ), "", "GET" ) ); +} + +void FactoryTest::createSessionWSBadAuthTest( ) +{ + lcl_init_mockup_ws( ); + + try + { + libcmis::SessionFactory::createSession( + BINDING_WS, "Bad User", "Bad Pass", + SERVER_REPOSITORY ); + CPPUNIT_FAIL( "Should throw exception" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", + string( "permissionDenied" ), e.getType( ) ); + } +} + +void FactoryTest::createSessionGDriveTest( ) +{ + lcl_init_mockup_gdrive( ); + + libcmis::OAuth2DataPtr oauth2Data( + new libcmis::OAuth2Data( GDRIVE_AUTH_URL, GDRIVE_TOKEN_URL, + OAUTH_SCOPE, OAUTH_REDIRECT_URI, + OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET )); + + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_GDRIVE, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY, false, + oauth2Data ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a GDriveSession", + dynamic_cast< GDriveSession* >( session.get() ) != NULL ); +} + +void FactoryTest::createSessionOneDriveTest( ) +{ + lcl_init_mockup_gdrive( ); + + libcmis::OAuth2DataPtr oauth2Data( + new libcmis::OAuth2Data( ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL, + OAUTH_SCOPE, OAUTH_REDIRECT_URI, + OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET )); + + libcmis::SessionFactory::setOAuth2AuthCodeProvider( authCodeFallback ); + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_ONEDRIVE, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY, false, + oauth2Data ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a OneDriveSession", + dynamic_cast< OneDriveSession* >( session.get() ) != NULL ); +} + +void FactoryTest::createSessionSharePointTest( ) +{ + lcl_init_mockup_sharepoint( ); + + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_SHAREPOINT, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a SharePoint Session", + dynamic_cast< SharePointSession* >( session.get() ) != NULL ); +} + +void FactoryTest::createSessionSharePointDefaultAuthTest( ) +{ + curl_mockup_addResponse( BINDING_SHAREPOINT.c_str( ), "", "GET", + DATA_DIR "/sharepoint/auth-xml-resp.xml", 200, true ); + curl_mockup_addResponse( CONTEXTINFO_URL.c_str( ), "", "POST", + DATA_DIR "/sharepoint/xdigest.json", 200, true ); + + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_SHAREPOINT, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a SharePoint Session", + dynamic_cast< SharePointSession* >( session.get() ) != NULL ); +} + +void FactoryTest::createSessionSharePointBadAuthTest( ) +{ + lcl_init_mockup_sharepoint( ); + + try + { + libcmis::SessionFactory::createSession( + BINDING_ATOM, "Bad user", "Bad Password", + SERVER_REPOSITORY ); + CPPUNIT_FAIL( "Should throw exception" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", + string( "permissionDenied" ), e.getType( ) ); + } +} + +void FactoryTest::createSessionNoCmisTest( ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( BINDING_BAD, "", "GET", + "<p>Some non CMIS content</p>", 200, false ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + unique_ptr< libcmis::Session > session( libcmis::SessionFactory::createSession( + BINDING_BAD, SERVER_USERNAME, SERVER_PASSWORD, + SERVER_REPOSITORY ) ); + CPPUNIT_ASSERT_MESSAGE( "Session should be NULL", !session ); +} diff --git a/qa/libcmis/test-gdrive.cxx b/qa/libcmis/test-gdrive.cxx new file mode 100644 index 0000000..c89017a --- /dev/null +++ b/qa/libcmis/test-gdrive.cxx @@ -0,0 +1,1318 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2013 Cao Cuong Ngo <cao.cuong.ngo@gmail.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <memory> +#include <string> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <libcmis/document.hxx> +#include <libcmis/session-factory.hxx> + +#include <mockup-config.h> + +#include "gdrive-session.hxx" +#include "gdrive-property.hxx" +#include "oauth2-handler.hxx" +#include "gdrive-object.hxx" + +using namespace std; +using namespace libcmis; + +static const string CLIENT_ID ( "mock-id" ); +static const string CLIENT_SECRET ( "mock-secret" ); +static const string USERNAME( "mock-user" ); +static const string PASSWORD( "mock-password" ); +static const string USERNAME2( "mock-user2" ); +static const string PASSWORD2( "mock-password2" ); +static const string LOGIN_URL ("https://login/url" ); +static const string LOGIN_URL2 ("https://login2/url" ); +static const string APPROVAL_URL ("https://approval/url" ); +static const string CHALLENGE_URL ("https://accounts.google.com/challenge/url" ); +static const string AUTH_URL ( "https://auth/url" ); +static const string TOKEN_URL ( "https://token/url" ); +static const string SCOPE ( "https://scope/url" ); +static const string REDIRECT_URI ("redirect:uri" ); +static const string BASE_URL ( "https://base/url" ); + +#define PIN "123321" + +namespace +{ + char* lcl_authCodeFallback( const char* /*url*/, const char* /*username*/, const char* /*password*/ ) + { + char *authCode = strdup( PIN ); + return authCode; + } +} + +typedef std::unique_ptr<GDriveSession> GDriveSessionPtr; + +class GDriveTest : public CppUnit::TestFixture +{ + public: + void sessionAuthenticationTest( ); + void sessionAuthenticationTestWith2FA( ); + void sessionExpiryTokenGetTest( ); + void sessionExpiryTokenPostTest( ); + void sessionExpiryTokenPutTest( ); + void sessionExpiryTokenDeleteTest( ); + void setRepositoryTest( ); + void getRepositoriesTest( ); + void getTypeTest( ); + void getObjectTest( ); + void getObjectByPathRootTest( ); + void getObjectByPathTest( ); + void getObjectByPathMissingTest( ); + void getDocumentTest( ); + void getFolderTest( ); + void getDocumentParentsTest( ); + void getContentStreamTest( ); + void setContentStreamTest( ); + void setContentStreamGdocTest( ); + void getChildrenTest( ); + void getDocumentAllowableActionsTest( ); + void getFolderAllowableActionsTest( ); + void checkOutTest( ); + void checkInTest( ); + void deleteTest( ); + void moveTest( ); + void createDocumentTest( ); + void createFolderTest( ); + void updatePropertiesTest( ); + void propertyCopyTest( ); + void removeTreeTest( ); + void getContentStreamWithRenditionsTest( ); + void getRefreshTokenTest( ); + void getThumbnailUrlTest( ); + void getAllVersionsTest( ); + + CPPUNIT_TEST_SUITE( GDriveTest ); + CPPUNIT_TEST( sessionAuthenticationTest ); + CPPUNIT_TEST( sessionAuthenticationTestWith2FA ); + CPPUNIT_TEST( sessionExpiryTokenGetTest ); + CPPUNIT_TEST( sessionExpiryTokenPutTest ); + CPPUNIT_TEST( sessionExpiryTokenPostTest ); + CPPUNIT_TEST( sessionExpiryTokenDeleteTest ); + CPPUNIT_TEST( setRepositoryTest ); + CPPUNIT_TEST( getRepositoriesTest ); + CPPUNIT_TEST( getTypeTest ); + CPPUNIT_TEST( getObjectTest ); + CPPUNIT_TEST( getObjectByPathRootTest ); + CPPUNIT_TEST( getObjectByPathTest ); + CPPUNIT_TEST( getObjectByPathMissingTest ); + CPPUNIT_TEST( getDocumentTest ); + CPPUNIT_TEST( getFolderTest ); + CPPUNIT_TEST( getDocumentParentsTest ); + CPPUNIT_TEST( getContentStreamTest ); + CPPUNIT_TEST( setContentStreamTest ); + CPPUNIT_TEST( setContentStreamGdocTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( getDocumentAllowableActionsTest ); + CPPUNIT_TEST( getFolderAllowableActionsTest ); + CPPUNIT_TEST( checkOutTest ); + CPPUNIT_TEST( checkInTest ); + CPPUNIT_TEST( deleteTest ); + CPPUNIT_TEST( moveTest ); + CPPUNIT_TEST( createDocumentTest ); + CPPUNIT_TEST( createFolderTest ); + CPPUNIT_TEST( updatePropertiesTest ); + CPPUNIT_TEST( propertyCopyTest ); + CPPUNIT_TEST( removeTreeTest ); + CPPUNIT_TEST( getContentStreamWithRenditionsTest ); + CPPUNIT_TEST( getRefreshTokenTest ); + CPPUNIT_TEST( getThumbnailUrlTest ); + CPPUNIT_TEST( getAllVersionsTest ); + CPPUNIT_TEST_SUITE_END( ); + + private: + GDriveSessionPtr getTestSession( string username, string password, bool with2FA = false ); +}; + +GDriveSessionPtr GDriveTest::getTestSession( string username, string password, bool with2FA ) +{ + libcmis::OAuth2DataPtr oauth2( + new libcmis::OAuth2Data( AUTH_URL, TOKEN_URL, SCOPE, + REDIRECT_URI, CLIENT_ID, CLIENT_SECRET )); + curl_mockup_reset( ); + string empty; + //login response + string loginIdentifier = string("scope=") + SCOPE + + string("&redirect_uri=") + REDIRECT_URI + + string("&response_type=code") + + string("&client_id=") + CLIENT_ID; + + curl_mockup_addResponse ( AUTH_URL.c_str(), loginIdentifier.c_str( ), + "GET", DATA_DIR "/gdrive/login1.html", 200, true); + + //authentication email + curl_mockup_addResponse( LOGIN_URL2.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/login2.html", 200, true); + + //challenge - pin code + if( with2FA == true ) + { + curl_mockup_addResponse( LOGIN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/challenge.html", 200, true); + + //approval response + curl_mockup_addResponse( CHALLENGE_URL.c_str( ), empty.c_str( ), + "POST", DATA_DIR "/gdrive/approve.html", 200, true); + } + else + { + //authentication password, + curl_mockup_addResponse( LOGIN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/approve.html", 200, true); + } + + //approval response + curl_mockup_addResponse( APPROVAL_URL.c_str( ), empty.c_str( ), + "POST", DATA_DIR "/gdrive/authcode.html", 200, true); + + curl_mockup_addResponse ( TOKEN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/token-response.json", 200, true ); + + return GDriveSessionPtr( new GDriveSession( BASE_URL, username, password, oauth2, false ) ); +} + +void GDriveTest::sessionAuthenticationTest( ) +{ + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string empty; + + // Check authentication request for email + string authRequestEmail( curl_mockup_getRequestBody( LOGIN_URL2.c_str(), empty.c_str( ), + "POST" ) ); + string expectedAuthRequestEmail = + string ( "Page=PasswordSeparationSignIn&continue=redirectLink&scope=Scope&service=lso&GALX=cookie" + "&Email=") + USERNAME; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Email", + expectedAuthRequestEmail, authRequestEmail ); + + // Check authentication request for password + string authRequestPassword( curl_mockup_getRequestBody( LOGIN_URL.c_str(), empty.c_str( ), + "POST" ) ); + string expectedAuthRequestPassword = + string ( "continue=redirectLink&scope=Scope&service=lso&GALX=cookie" + "&Passwd=") + PASSWORD; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Password", + expectedAuthRequestPassword, authRequestPassword ); + + // Check code request + string codeRequest( curl_mockup_getRequestBody( APPROVAL_URL.c_str(), + empty.c_str( ), "POST" ) ); + string expectedCodeRequest = string( "state_wrapper=stateWrapper&submit_access=true" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong approval request", + expectedCodeRequest, codeRequest); + + // Check token request + string expectedTokenRequest = + string( "code=AuthCode") + + string( "&client_id=") + CLIENT_ID + + string( "&redirect_uri=") + REDIRECT_URI + + string( "&scope=") + SCOPE + + string( "&grant_type=authorization_code" ); + + string tokenRequest( curl_mockup_getRequestBody( TOKEN_URL.c_str(), empty.c_str( ), + "POST" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong token request", + expectedTokenRequest, tokenRequest ); + + // Check token + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Wrong access token", + string ( "mock-access-token" ), + session->m_oauth2Handler->getAccessToken( )); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Wrong refresh token", + string ("mock-refresh-token"), + session->m_oauth2Handler->getRefreshToken( )); +} + +void GDriveTest::sessionAuthenticationTestWith2FA( ) +{ + libcmis::SessionFactory::setOAuth2AuthCodeProvider( lcl_authCodeFallback ); + + GDriveSessionPtr session = getTestSession( USERNAME2, PASSWORD2, true ); + string empty; + + // Check authentication request for email + string authRequestEmail( curl_mockup_getRequestBody( LOGIN_URL2.c_str(), empty.c_str( ), + "POST" ) ); + string expectedAuthRequestEmail = + string ( "Page=PasswordSeparationSignIn&continue=redirectLink&scope=Scope&service=lso&GALX=cookie" + "&Email=") + USERNAME2; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Email", + expectedAuthRequestEmail, authRequestEmail ); + + // Check authentication request for password + string authRequestPassword( curl_mockup_getRequestBody( LOGIN_URL.c_str(), empty.c_str( ), + "POST" ) ); + string expectedAuthRequestPassword = + string ( "continue=redirectLink&scope=Scope&service=lso&GALX=cookie" + "&Passwd=") + PASSWORD2; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Password", + expectedAuthRequestPassword, authRequestPassword ); + + // Check request for pin code + string authRequestPin( curl_mockup_getRequestBody( CHALLENGE_URL.c_str(), empty.c_str( ), + "POST" ) ); + string expectedAuthRequestPin = + string ( "continue=redirectLink&scope=Scope&service=lso&GALX=cookie" + "&Pin=") + PIN; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong authentication request for Pin", + expectedAuthRequestPin, authRequestPin ); + + // Check code request + string codeRequest( curl_mockup_getRequestBody( APPROVAL_URL.c_str(), + empty.c_str( ), "POST" ) ); + string expectedCodeRequest = string( "state_wrapper=stateWrapper&submit_access=true" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong approval request", + expectedCodeRequest, codeRequest); + + // Check token request + string expectedTokenRequest = + string( "code=AuthCode") + + string( "&client_id=") + CLIENT_ID + + string( "&redirect_uri=") + REDIRECT_URI + + string( "&scope=") + SCOPE + + string( "&grant_type=authorization_code" ); + + string tokenRequest( curl_mockup_getRequestBody( TOKEN_URL.c_str(), empty.c_str( ), + "POST" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong token request", + expectedTokenRequest, tokenRequest ); + + // Check token + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Wrong access token", + string ( "mock-access-token" ), + session->m_oauth2Handler->getAccessToken( )); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Wrong refresh token", + string ("mock-refresh-token"), + session->m_oauth2Handler->getRefreshToken( )); +} + +void GDriveTest::sessionExpiryTokenGetTest( ) +{ + // Access_token will expire after expires_in seconds, + // We need to use the refresh key to get a new one. + + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + curl_mockup_reset( ); + static const string objectId("aFileId"); + string url = BASE_URL + "/files/" + objectId; + + // 401 response, token is expired + curl_mockup_addResponse( url.c_str( ),"", "GET", "", 401, false ); + + curl_mockup_addResponse( TOKEN_URL.c_str(), "", + "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); + try + { + // GET expires, need to refresh then GET again + libcmis::ObjectPtr obj = session->getObject( objectId ); + } + catch ( ... ) + { + if ( session->getHttpStatus( ) == 401 ) + { + // Check if access token is refreshed + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "wrong access token", + string ( "new-access-token" ), + session->m_oauth2Handler->getAccessToken( ) ); + } + } +} + +void GDriveTest::sessionExpiryTokenPostTest( ) +{ + // Access_token will expire after expires_in seconds, + // We need to use the refresh key to get a new one. + + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + curl_mockup_reset( ); + static const string folderId("aFileId"); + const string folderUrl = BASE_URL + "/files/" + folderId; + const string metaUrl = BASE_URL + "/files"; + + curl_mockup_addResponse( TOKEN_URL.c_str(), "", + "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); + + curl_mockup_addResponse( folderUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true ); + + // 401 response, token is expired + // refresh and then POST again + curl_mockup_addResponse( metaUrl.c_str( ), "", + "POST", "", 401, false ); + libcmis::FolderPtr parent = session->getFolder( folderId ); + + try + { + PropertyPtrMap properties; + // POST expires, need to refresh then POST again + parent->createFolder( properties ); + } + catch ( ... ) + { + if ( session->getHttpStatus( ) == 401 ) + { + // Check if access token is refreshed + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "wrong access token", + string ( "new-access-token" ), + session->m_oauth2Handler->getAccessToken( ) ); + } + } +} + +void GDriveTest::sessionExpiryTokenDeleteTest( ) +{ + // Access_token will expire after expires_in seconds, + // We need to use the refresh key to get a new one. + + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + curl_mockup_reset( ); + static const string objectId("aFileId"); + string url = BASE_URL + "/files/" + objectId; + + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document2.json", 200, true); + + curl_mockup_addResponse( TOKEN_URL.c_str(), "", + "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); + // 401 response, token is expired + curl_mockup_addResponse( url.c_str( ),"", "DELETE", "", 401, false); + + libcmis::ObjectPtr obj = session->getObject( objectId ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + try + { + // DELETE expires, need to refresh then DELETE again + object->remove( ); + } + catch ( ... ) + { + if ( session->getHttpStatus( ) == 401 ) + { + // Check if access token is refreshed + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "wrong access token", + string ( "new-access-token" ), + session->m_oauth2Handler->getAccessToken( ) ); + const struct HttpRequest* deleteRequest = curl_mockup_getRequest( url.c_str( ), "", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "Delete request not sent", deleteRequest ); + curl_mockup_HttpRequest_free( deleteRequest ); + } + } + +} + +void GDriveTest::sessionExpiryTokenPutTest( ) +{ + // Access_token will expire after expires_in seconds, + // We need to use the refresh key to get a new one. + + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + curl_mockup_reset( ); + static const string objectId("aFileId"); + string url = BASE_URL + "/files/" + objectId; + + curl_mockup_addResponse( TOKEN_URL.c_str(), "", + "POST", DATA_DIR "/gdrive/refresh_response.json", 200, true); + + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true ); + + // 401 response, token is expired + curl_mockup_addResponse( url.c_str( ),"", "PUT", "", 401, false ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + try + { + // PUT expires, need to refresh then PUT again + object->updateProperties( object->getProperties( ) ); + } + catch ( ... ) + { + if ( session->getHttpStatus( ) == 401 ) + { + // Check if access token is refreshed + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "wrong access token", + string ( "new-access-token" ), + session->m_oauth2Handler->getAccessToken( ) ); + } + } +} + +void GDriveTest::setRepositoryTest( ) +{ + GDriveSession session; + CPPUNIT_ASSERT_MESSAGE( "Should never fail", session.setRepository( "foobar" ) ); +} + +void GDriveTest::getDocumentTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFileId"); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/files/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( objectId ); + + // Check if we got the document object. + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); + + // Test the document properties + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", objectId, document->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", + string( "GDrive File" ), + document->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", + string( "application/vnd.google-apps.form" ), + document->getContentType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type", string( "cmis:document" ), document->getType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); + + CPPUNIT_ASSERT_MESSAGE( "Content length is incorrect", 123 == document->getContentLength( ) ); +} + +void GDriveTest::getFolderTest( ) +{ + curl_mockup_reset( ); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + static const string folderId( "aFolderId" ); + static const string parentId( "parentID" ); + string url = BASE_URL + "/files/" + folderId; + string parentUrl = BASE_URL + "/files/" + parentId; + + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + curl_mockup_addResponse( parentUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + // Check if we got the Folder object. + libcmis::FolderPtr folder = session->getFolder( folderId ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::FolderPtr", + NULL != folder ); + + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", folderId, folder->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "testFolder" ), folder->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), folder->getBaseType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type", string( "cmis:folder" ), folder->getType( ) ); + CPPUNIT_ASSERT_MESSAGE( "Missing folder parent", folder->getFolderParent( ).get( ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !folder->isRootFolder() ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !folder->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !folder->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !folder->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !folder->getLastModificationDate( ).is_not_a_date_time() ); +} + +void GDriveTest::getDocumentParentsTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + static const string documentId( "aFileId" ); + static const string parentId( "aFolderId" ); + static const string parentId2( "aNewFolderId" ); + string url = BASE_URL + "/files/" + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + + string parent1Url = BASE_URL + "/files/" + parentId; + string parent2Url = BASE_URL + "/files/" + parentId2; + curl_mockup_addResponse( parent1Url.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + curl_mockup_addResponse( parent2Url.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder2.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( "aFileId" ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); + + vector< libcmis::FolderPtr > parents= document->getParents( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 2 ), parents.size() ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent Id", parentId, parents[0]->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent Id", parentId2, parents[1]->getId( ) ); +} + +void GDriveTest::getContentStreamTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + static const string documentId( "aFileId" ); + string url = BASE_URL + "/files/" + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + string expectedContent( "Test content stream" ); + string downloadUrl = "https://downloadLink"; + curl_mockup_addResponse( downloadUrl.c_str( ), "", "GET", expectedContent.c_str( ), 0, false ); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + try + { + boost::shared_ptr< istream > is = document->getContentStream( ); + ostringstream out; + out << is->rdbuf(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", expectedContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void GDriveTest::setContentStreamTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + const string documentId( "aFileId" ); + const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; + + string url = BASE_URL + "/files/" + documentId; + string putUrl = uploadBaseUrl + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document2.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + curl_mockup_addResponse( url.c_str( ), "", + "PUT", DATA_DIR "/gdrive/document2.json", 200, true); + curl_mockup_addResponse( putUrl.c_str( ), "", "PUT", "Updated", 0, false ); + try + { + string expectedContent( "Test set content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "aFileName" ); + document->setContentStream( os, "text/plain", filename ); + + CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); + + // Check if metadata has been properly uploaded + const char* meta = curl_mockup_getRequestBody( url.c_str( ), "", "PUT" ); + string expectedMeta = "{\n \"title\": \"aFileName\"\n}\n"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad meta uploaded", expectedMeta, string( meta ) ); + // Check the content has been properly uploaded + const char* content = curl_mockup_getRequestBody( putUrl.c_str( ), "", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void GDriveTest::setContentStreamGdocTest( ) +{ + + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + const string documentId( "aFileId" ); + const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; + + string url = BASE_URL + "/files/" + documentId; + string putUrl = uploadBaseUrl + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + curl_mockup_addResponse( url.c_str( ), "convert=true", + "PUT", DATA_DIR "/gdrive/document.json", 200, true); + curl_mockup_addResponse( putUrl.c_str( ), "convert=true", "PUT", "Updated", 0, false ); + try + { + string expectedContent( "Test set content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "aFileName" ); + document->setContentStream( os, "text/plain", filename ); + + CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); + + // Check the content has been properly uploaded + const char* content = curl_mockup_getRequestBody( putUrl.c_str( ), "", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void GDriveTest::getChildrenTest( ) +{ + curl_mockup_reset( ); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + static const string folderId ("aFolderId"); + string url = BASE_URL + "/files/" + folderId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + + string urlChildFolder = BASE_URL + "/files/" + string ("aChildFolder"); + curl_mockup_addResponse( urlChildFolder.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + + string urlChildDocument = BASE_URL + "/files/" + string ("aChildDocument"); + curl_mockup_addResponse( urlChildDocument.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( folderId ); + + // Check if we got the Folder object. + libcmis::FolderPtr folder = boost::dynamic_pointer_cast< libcmis::Folder >( obj ); + + CPPUNIT_ASSERT_MESSAGE( "Folder expected", folder != NULL ); + + + string query = "q=\"" + folderId + "\"+in+parents+and+trashed+=+false"; + string childrenUrl = BASE_URL + "/files"; + curl_mockup_addResponse( childrenUrl.c_str( ), query.c_str( ), + "GET", DATA_DIR "/gdrive/folder_children.json", 200, true); + + vector< libcmis::ObjectPtr > children= folder->getChildren( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of children", size_t( 2 ), children.size() ); + + int folderCount = 0; + int documentCount = 0; + for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); + it != children.end( ); ++it ) + { + if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) + ++folderCount; + else if ( NULL != boost::dynamic_pointer_cast< libcmis::Document >( *it ) ) + ++documentCount; + } + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 1, folderCount ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of document children", 1, documentCount ); +} + +void GDriveTest::getTypeTest( ) +{ + curl_mockup_reset( ); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + string expectedId( "cmis:document" ); + libcmis::ObjectTypePtr actual = session->getType( expectedId ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched type", expectedId, actual->getId( ) ); +} + +void GDriveTest::getRepositoriesTest( ) +{ + curl_mockup_reset( ); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + vector< libcmis::RepositoryPtr > actual = session->getRepositories( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), + actual.size( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong repository found", + string ( "GoogleDrive" ), + actual.front()->getId( ) ); +} + +void GDriveTest::getObjectTest() +{ + static const string objectId ("aFileId"); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/files/" + objectId; + curl_mockup_addResponse ( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/gdoc-file.json", 200, true); + libcmis::ObjectPtr object = session->getObject( objectId ); + boost::shared_ptr<GDriveObject> obj = boost::dynamic_pointer_cast + <GDriveObject>(object); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Object Id", objectId, + obj->getId( ) ); +} + +void GDriveTest::getObjectByPathRootTest() +{ + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string rootUrl = BASE_URL + "/files/root"; + curl_mockup_addResponse ( rootUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + + libcmis::ObjectPtr object = session->getObjectByPath( "/" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Object Id", + string("testFolder"), object->getName( ) ); +} + +void GDriveTest::getObjectByPathTest() +{ + // Mockup setup + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string rootChildUrl = BASE_URL + "/files/root/children/"; + curl_mockup_addResponse ( rootChildUrl.c_str( ), "q=title+=+'GDrive File'", + "GET", DATA_DIR "/gdrive/root_child_search.json", 200, true ); + + string urlRootChildDoc = BASE_URL + "/files/aRootChildId2"; + curl_mockup_addResponse( urlRootChildDoc.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true ); + + // Tested method + libcmis::ObjectPtr object = session->getObjectByPath( "/GDrive File" ); + + // Check the result + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Object", + string("GDrive File"), object->getName( ) ); +} + +void GDriveTest::getObjectByPathMissingTest() +{ + // Mockup setup + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string rootChildUrl = BASE_URL + "/files/root/children/"; + curl_mockup_addResponse ( rootChildUrl.c_str( ), "q=title+=+'GDrive File'", + "GET", DATA_DIR "/gdrive/root_child_missing.json", 200, true ); + + // Tested method + try + { + libcmis::ObjectPtr object = session->getObjectByPath( "/GDrive File" ); + CPPUNIT_FAIL( "objectNotFound exception expected" ); + } + catch ( libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE("Bad exception type", + string( "objectNotFound" ), e.getType( ) ); + } +} + +void GDriveTest::getDocumentAllowableActionsTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFileId"); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/files/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( objectId ); + + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); + + boost::shared_ptr< libcmis::AllowableActions > actions = document->getAllowableActions( ); + + CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be true", + actions->isDefined( libcmis::ObjectAction::GetContentStream ) && + actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); + CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be false", + actions->isDefined( libcmis::ObjectAction::CreateDocument ) && + !actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); +} + +void GDriveTest::getFolderAllowableActionsTest( ) +{ + curl_mockup_reset( ); + static const string folderId ("aFolderId"); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/files/" + folderId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true); + + libcmis::FolderPtr folder = session->getFolder( folderId ); + + boost::shared_ptr< libcmis::AllowableActions > actions = folder->getAllowableActions( ); + + CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be true", + actions->isDefined( libcmis::ObjectAction::CreateDocument ) && + actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); + + CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be false", + actions->isDefined( libcmis::ObjectAction::GetContentStream ) && + !actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); +} + +void GDriveTest::checkOutTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + static const string documentId( "aFileId" ); + string url = BASE_URL + "/files/" + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + libcmis::DocumentPtr checkout = document->checkOut( ); + CPPUNIT_ASSERT_MESSAGE( "CheckOut failed", NULL != checkout ); +} + +void GDriveTest::checkInTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + const string documentId( "aFileId" ); + const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; + + string url = BASE_URL + "/files/" + documentId; + string putUrl = uploadBaseUrl + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document2.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + curl_mockup_addResponse( url.c_str( ), "", + "PUT", DATA_DIR "/gdrive/document2.json", 200, true); + curl_mockup_addResponse( putUrl.c_str( ), "", "PUT", "Updated", 0, false ); + + string expectedContent( "content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "aFileName" ); + + const PropertyPtrMap& properties = document->getProperties( ); + libcmis::DocumentPtr checkIn = document->checkIn( true, "", properties, os, "text/plain", filename); + CPPUNIT_ASSERT_MESSAGE( "CheckIn failed", NULL != checkIn ); +} + +void GDriveTest::deleteTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + const string objectId( "aFileId" ); + + string url = BASE_URL + "/files/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document2.json", 200, true); + curl_mockup_addResponse( url.c_str( ),"", "DELETE", "", 204, false); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + object->remove( ); + const struct HttpRequest* deleteRequest = curl_mockup_getRequest( url.c_str( ), "", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "Delete request not sent", deleteRequest ); + curl_mockup_HttpRequest_free( deleteRequest ); +} + +void GDriveTest::moveTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string objectId( "aFileId" ); + const string sourceId( "aFolderId" ); + const string desId( "aNewFolderId" ); + + string url = BASE_URL + "/files/" + objectId; + string sourceUrl = BASE_URL + "/files/" + sourceId; + string desUrl = BASE_URL + "/files/" + desId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document2.json", 200, true ); + curl_mockup_addResponse( url.c_str( ), "", + "PUT", DATA_DIR "/gdrive/document2.json", 200, true ); + curl_mockup_addResponse( sourceUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true ); + curl_mockup_addResponse( desUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder2.json", 200, true ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + libcmis::FolderPtr source = session->getFolder( sourceId ); + libcmis::FolderPtr destination = session->getFolder( desId ); + + object->move( source, destination ); + const char* moveRequest = curl_mockup_getRequestBody( url.c_str( ), "", "PUT" ); + Json parentJson = Json::parse( string( moveRequest ) ); + string newParentId = parentJson["parents"].getList().front()["id"].toString( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad new parent folder", + desId, newParentId); +} + +void GDriveTest::createDocumentTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string documentId( "aFileId" ); + const string folderId( "aFolderId" ); + + const string folderUrl = BASE_URL + "/files/" + folderId; + const string metaUrl = BASE_URL + "/files/"; + const string uploadBaseUrl = "https://www.googleapis.com/upload/drive/v2/files/"; + string uploadUrl = uploadBaseUrl + documentId; + string documentUrl = metaUrl + documentId; + + curl_mockup_addResponse( folderUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true ); + curl_mockup_addResponse( metaUrl.c_str( ), "", + "POST", DATA_DIR "/gdrive/document.json", 200, true ); + curl_mockup_addResponse( uploadUrl.c_str( ), "", + "PUT", "updated", 0, false ); + curl_mockup_addResponse( documentUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/document2.json", 200, true); + + libcmis::FolderPtr parent = session->getFolder( folderId ); + + try + { + string expectedContent( "Test set content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "aFileName" ); + PropertyPtrMap properties; + + // function to test + parent->createDocument( properties, os, "text/plain", filename ); + + const char* createRequest = curl_mockup_getRequestBody( metaUrl.c_str( ), "", "POST" ); + Json request = Json::parse( string( createRequest ) ); + string sentParentId = request["parents"].getList( ).front( )["id"].toString( ); + string sentFilename = request["title"].toString( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad parents sent", folderId, sentParentId ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad filename sent", filename, sentFilename ); + + const char* content = curl_mockup_getRequestBody( uploadUrl.c_str( ), "", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void GDriveTest::createFolderTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string folderId( "aFolderId" ); + + const string folderUrl = BASE_URL + "/files/" + folderId; + const string metaUrl = BASE_URL + "/files/"; + + curl_mockup_addResponse( folderUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true ); + curl_mockup_addResponse( metaUrl.c_str( ), "", + "POST", DATA_DIR "/gdrive/folder2.json", 200, true ); + libcmis::FolderPtr parent = session->getFolder( folderId ); + try + { + PropertyPtrMap properties; + + // function to test + parent->createFolder( properties ); + + const char* createRequest = curl_mockup_getRequestBody( metaUrl.c_str( ), "", "POST" ); + Json request = Json::parse( string( createRequest ) ); + + string sentParentId = request["parents"].getList( ).front( )["id"].toString( ); + string sentMimeType = request["mimeType"].toString( ); + string expectedMimeType( "application/vnd.google-apps.folder" ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad parents sent", folderId, sentParentId ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad mimeType", expectedMimeType, sentMimeType ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void GDriveTest::removeTreeTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string folderId( "aFolderId" ); + + const string folderUrl = BASE_URL + "/files/" + folderId; + const string trashUrl = folderUrl + "/trash"; + + curl_mockup_addResponse( folderUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/folder.json", 200, true ); + curl_mockup_addResponse( trashUrl.c_str( ), "", + "POST", "", 200, false ); + libcmis::FolderPtr folder = session->getFolder( folderId ); + + // just make sure it doesn't crash + folder->removeTree( ); +} + +void GDriveTest::getContentStreamWithRenditionsTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + static const string documentId( "aFileId" ); + string url = BASE_URL + "/files/" + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + // pdf stream + string pdfContent( "pdf Content stream" ); + string pdfUrl = "pdflink"; + curl_mockup_addResponse( pdfUrl.c_str( ), "", "GET", pdfContent.c_str( ), 0, false ); + + try + { + boost::shared_ptr< istream > is = document->getContentStream( "application/pdf" ); + ostringstream out; + out << is->rdbuf(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", pdfContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } + + // ODF stream + string odfContent( "open document Content stream" ); + string odfUrl = "https://downloadLink"; + curl_mockup_addResponse( odfUrl.c_str( ), "", "GET", odfContent.c_str( ), 0, false ); + try + { + boost::shared_ptr< istream > is = document->getContentStream( "application/x-vnd.oasis.opendocument.spreadsheet" ); + ostringstream out; + out << is->rdbuf(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", odfContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } + + // MS stream + string msContent( "office document Content stream" ); + string msUrl = "xlslink"; + curl_mockup_addResponse( msUrl.c_str( ), "", "GET", msContent.c_str( ), 0, false ); + try + { + boost::shared_ptr< istream > is = document->getContentStream( + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ); + ostringstream out; + out << is->rdbuf(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", msContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void GDriveTest::updatePropertiesTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string documentId( "aFileId" ); + const string documentUrl = BASE_URL + "/files/" + documentId; + curl_mockup_addResponse( documentUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true ); + curl_mockup_addResponse( documentUrl.c_str( ), "", + "PUT", DATA_DIR "/gdrive/document-updated.json", 200, true ); + + + // Values for the test + string propertyName( "cmis:name" ); + string expectedValue( "New Title" ); + libcmis::ObjectPtr object = session->getObject( documentId ); + + // Fill the map of properties to change + PropertyPtrMap newProperties; + + libcmis::ObjectTypePtr objectType = object->getTypeDescription( ); + map< string, libcmis::PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( propertyName ); + vector< string > values; + values.push_back( expectedValue ); + libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); + newProperties[ propertyName ] = property; + + // Update the properties (method to test) + object->updateProperties( newProperties ); + + // Check that the sent request is OK + const char* updateRequest = curl_mockup_getRequestBody( documentUrl.c_str( ), "", "PUT" ); + + // Check the sent properties + Json json = Json::parse( string( updateRequest ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Only the updated properties should be sent", + size_t( 1 ), json.getObjects().size( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "title key not present", + expectedValue, json["title"].toString( ) ); + + // Check that the object is updated + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Object not updated", + expectedValue, object->getName() ); +} + +void GDriveTest::propertyCopyTest( ) +{ + string name = "cmis:name"; + string value = "some value"; + + GDriveProperty property( name, Json( value.c_str() ) ); + { + GDriveProperty copy = property; + + CPPUNIT_ASSERT_EQUAL( name, copy.getPropertyType()->getId() ); + CPPUNIT_ASSERT_EQUAL( value, copy.getStrings()[0] ); + } + + { + GDriveProperty copy; + copy = property; + + CPPUNIT_ASSERT_EQUAL( name, copy.getPropertyType()->getId() ); + CPPUNIT_ASSERT_EQUAL( value, copy.getStrings()[0] ); + } +} + +void GDriveTest::getRefreshTokenTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Refresh token does not match", + string ("mock-refresh-token"), + session->getRefreshToken( ) ); +} + +void GDriveTest::getThumbnailUrlTest( ) +{ + curl_mockup_reset( ); + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string documentId( "aFileId" ); + + const string documentUrl = BASE_URL + "/files/" + documentId; + + curl_mockup_addResponse( documentUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true ); + + libcmis::ObjectPtr document = session->getObject( documentId ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Thumbnail URL does not match", + string ("https://aThumbnailLink"), + document->getThumbnailUrl( ) ); + +} + +void GDriveTest::getAllVersionsTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFileId"); + + GDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/files/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/gdrive/document.json", 200, true); + string revisionUrl = url + "/revisions"; + curl_mockup_addResponse( revisionUrl.c_str( ), "", + "GET", DATA_DIR "/gdrive/allVersions.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( objectId ); + + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); + + // Method to test + vector< libcmis::DocumentPtr > versions = document->getAllVersions( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of versions", size_t( 3 ), versions.size( ) ); +} + +CPPUNIT_TEST_SUITE_REGISTRATION( GDriveTest ); + diff --git a/qa/libcmis/test-helpers.cxx b/qa/libcmis/test-helpers.cxx new file mode 100644 index 0000000..0ef2452 --- /dev/null +++ b/qa/libcmis/test-helpers.cxx @@ -0,0 +1,187 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <libxml/parser.h> +#include <libxml/tree.h> + +#include <libcmis/xml-utils.hxx> + +#include "test-helpers.hxx" + +using namespace std; +using libcmis::PropertyPtrMap; + +namespace test +{ + + XmlNodeRef::XmlNodeRef( xmlNodePtr node, boost::shared_ptr< xmlDoc > doc ) + : m_node( node ) + , m_doc( doc ) + { + } + + XmlNodeRef::XmlNodeRef( const XmlNodeRef& other ) + : m_node( other.m_node ) + , m_doc( other.m_doc ) + { + } + + XmlNodeRef& XmlNodeRef::operator=( const XmlNodeRef& other ) + { + m_node = other.m_node; + m_doc = other.m_doc; + return *this; + } + + XmlNodeRef::operator xmlNodePtr( ) const + { + return m_node; + } + + XmlNodeRef getXmlNode( string str ) + { + xmlNodePtr node = NULL; + const boost::shared_ptr< xmlDoc > doc( xmlReadMemory( str.c_str( ), str.size( ), "tester", NULL, 0 ), xmlFreeDoc ); + if ( bool( doc ) ) + node = xmlDocGetRootElement( doc.get() ); + + return XmlNodeRef( node, doc ); + } + + const char* getXmlns( ) + { + return "xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\" "; + } + + string writeXml( boost::shared_ptr< libcmis::XmlSerializable > serializable ) + { + xmlBufferPtr buf = xmlBufferCreate( ); + xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); + + xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); + serializable->toXml( writer ); + xmlTextWriterEndDocument( writer ); + + string str( ( const char * )xmlBufferContent( buf ) ); + + xmlFreeTextWriter( writer ); + xmlBufferFree( buf ); + + return str; + } + + string getXmlNodeAsString( const string& xmlDoc, const string& xpath ) + { + string result; + xmlDocPtr doc = xmlReadMemory( xmlDoc.c_str(), xmlDoc.size(), "", NULL, 0 ); + + if ( NULL != doc ) + { + xmlXPathContextPtr xpathCtx = xmlXPathNewContext( doc ); + libcmis::registerNamespaces( xpathCtx ); + libcmis::registerCmisWSNamespaces( xpathCtx ); + + if ( NULL != xpathCtx ) + { + xmlXPathObjectPtr xpathObj = xmlXPathEvalExpression( BAD_CAST( xpath.c_str() ), xpathCtx ); + + if ( xpathObj != NULL ) + { + int nbResults = 0; + if ( xpathObj->nodesetval ) + nbResults = xpathObj->nodesetval->nodeNr; + + for ( int i = 0; i < nbResults; ++i ) + { + xmlNodePtr node = xpathObj->nodesetval->nodeTab[i]; + xmlBufferPtr buf = xmlBufferCreate( ); + xmlNodeDump( buf, doc, node, 0, 0 ); + result += string( ( char * )xmlBufferContent( buf ) ); + xmlBufferFree( buf ); + } + } + xmlXPathFreeObject( xpathObj); + } + xmlXPathFreeContext( xpathCtx ); + } + else + throw libcmis::Exception( "Failed to parse service document" ); + + xmlFreeDoc( doc ); + + return result; + } + + libcmis::DocumentPtr createVersionableDocument( libcmis::Session* session, string docName ) + { + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "VersionableType" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( docName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "VersionableType" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Actually send the document creation request + string contentStr = "Some content"; + boost::shared_ptr< ostream > os ( new stringstream( contentStr ) ); + string contentType = "text/plain"; + string filename( "name.txt" ); + + return parent->createDocument( props, os, contentType, filename ); + } + + void loadFromFile( const char* path, string& buf ) + { + ifstream in( path ); + + in.seekg( 0, ios::end ); + int length = in.tellg( ); + in.seekg( 0, ios::beg ); + + char* buffer = new char[length]; + in.read( buffer, length ); + in.close( ); + + buf = string( buffer, length ); + delete[] buffer; + } +} diff --git a/qa/libcmis/test-helpers.hxx b/qa/libcmis/test-helpers.hxx new file mode 100644 index 0000000..9e02357 --- /dev/null +++ b/qa/libcmis/test-helpers.hxx @@ -0,0 +1,63 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <string> + +#include <boost/shared_ptr.hpp> +#include <libxml/tree.h> + +#include <libcmis/document.hxx> +#include <libcmis/session.hxx> +#include <libcmis/xmlserializable.hxx> + +namespace test +{ + class XmlNodeRef + { + public: + XmlNodeRef( xmlNodePtr node, boost::shared_ptr< xmlDoc > doc ); + XmlNodeRef( const XmlNodeRef& other ); + XmlNodeRef& operator=( const XmlNodeRef& other ); + + operator xmlNodePtr( ) const; + + private: + xmlNodePtr m_node; + boost::shared_ptr< xmlDoc > m_doc; + }; + + // Test helper functions for parser and writer tests + XmlNodeRef getXmlNode( std::string str ); + const char* getXmlns( ); + std::string writeXml( boost::shared_ptr< libcmis::XmlSerializable > serializable ); + + std::string getXmlNodeAsString( const std::string& xmlDoc, const std::string& xpath ); + + libcmis::DocumentPtr createVersionableDocument( libcmis::Session* session, std::string docName ); + void loadFromFile( const char* path, std::string& buf ); +} diff --git a/qa/libcmis/test-jsonutils.cxx b/qa/libcmis/test-jsonutils.cxx new file mode 100644 index 0000000..4a9fd49 --- /dev/null +++ b/qa/libcmis/test-jsonutils.cxx @@ -0,0 +1,182 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2013 Cao Cuong Ngo <cao.cuong.ngo@gmail.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <string> +#include <fstream> +#include <cerrno> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <libcmis/property.hxx> +#include <libcmis/property-type.hxx> + +#include "json-utils.hxx" + +using namespace std; +using namespace libcmis; + +class JsonTest : public CppUnit::TestFixture +{ + public: + void parseTest( ); + void parseTypeTest( ); + void createFromPropertyTest( ); + void createFromPropertiesTest( ); + void badKeyTest( ); + void addTest( ); + + CPPUNIT_TEST_SUITE( JsonTest ); + CPPUNIT_TEST( parseTest ); + CPPUNIT_TEST( parseTypeTest ); + CPPUNIT_TEST( createFromPropertyTest ); + CPPUNIT_TEST( createFromPropertiesTest ); + CPPUNIT_TEST( badKeyTest ); + CPPUNIT_TEST( addTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +string getFileContents( const char *filename) +{ + std::ifstream in( filename, std::ios::in | std::ios::binary ); + if (in) + { + std::string contents; + in.seekg( 0, std::ios::end ); + contents.resize(in.tellg( ) ); + in.seekg( 0, std::ios::beg ); + in.read( &contents[0], contents.size( ) ); + in.close( ); + return contents; + } + throw ( errno ); +} + +Json parseFile( string fileName ) +{ + Json json = Json::parse( getFileContents( fileName.c_str( ) ) ); + return json; +} + +void JsonTest::parseTest( ) +{ + Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); + string kind = json["kind"].toString( ); + string id = json["id"].toString( ); + string mimeType = json["mimeType"].toString( ); + string createdDate = json["createdDate"].toString( ); + string intTest = json["intTest"].toString( ); + string doubleTest = json["doubleTest"].toString( ); + string editable = json["editable"].toString( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong kind", string( "drive#file" ), kind ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", string( "aFileId"), id ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong mimeType", string( "application/vnd.google-apps.form"), mimeType ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong createdDate", string( "2010-04-28T14:53:23.141Z"), createdDate ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong intTest", string("-123"), intTest ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong doubleTest", string("-123.456"), doubleTest ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong editable", string( "true"), editable ); +} + +void JsonTest::parseTypeTest( ) +{ + Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); + Json::Type stringType = json["kind"].getDataType( ); + Json::Type boolType = json["editable"].getDataType( ); + Json::Type intType = json["intTest"].getDataType( ); + Json::Type doubleType = json["doubleTest"].getDataType( ); + Json::Type dateTimeType = json["createdDate"].getDataType( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong string type", Json::json_string, stringType ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong bool type", Json::json_bool, boolType ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong int type", Json::json_int, intType ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong double type", Json::json_double, doubleType ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong datetime type", Json::json_datetime, dateTimeType ); +} + +void JsonTest::createFromPropertyTest( ) +{ + vector< string > values; + string expected("Value 1" ); + values.push_back( expected ); + + PropertyTypePtr propertyType( new PropertyType( ) ); + + PropertyPtr property( new Property( propertyType, values ) ); + + Json json( property ); + + CPPUNIT_ASSERT_EQUAL( expected, json.toString( ) ); +} + +void JsonTest::createFromPropertiesTest( ) +{ + vector< string > values; + string expected( "value" ); + values.push_back( "value" ); + + PropertyTypePtr propertyType( new PropertyType( ) ); + + PropertyPtr property( new libcmis::Property( propertyType, values ) ); + + PropertyPtrMap properties; + properties[ "key" ] = property; + + Json json( properties ); + + CPPUNIT_ASSERT_EQUAL( expected, json["key"].toString( ) ); +} + +void JsonTest::badKeyTest( ) +{ + Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); + // just make sure it doesn't crash here + string notExist = json["nonExistedKey"].toString( ); + CPPUNIT_ASSERT_EQUAL( string( ), notExist); +} + +void JsonTest::addTest( ) +{ + Json json = parseFile( DATA_DIR "/gdrive/jsontest-good.json" ); + Json addJson("added"); + json.add( "new", addJson); + CPPUNIT_ASSERT_EQUAL( addJson.toString( ), json["new"].toString( ) ); +} + +CPPUNIT_TEST_SUITE_REGISTRATION( JsonTest ); diff --git a/qa/libcmis/test-main.cxx b/qa/libcmis/test-main.cxx new file mode 100644 index 0000000..23555e9 --- /dev/null +++ b/qa/libcmis/test-main.cxx @@ -0,0 +1,39 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/TestFactoryRegistry.h> +#include <cppunit/ui/text/TestRunner.h> + +int main( int, char** ) +{ + CppUnit::TextUi::TestRunner runner; + CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry(); + runner.addTest( registry.makeTest() ); + bool wasSuccess = runner.run( "", false ); + return !wasSuccess; +} diff --git a/qa/libcmis/test-mockup-helpers.cxx b/qa/libcmis/test-mockup-helpers.cxx new file mode 100644 index 0000000..40c3605 --- /dev/null +++ b/qa/libcmis/test-mockup-helpers.cxx @@ -0,0 +1,50 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <test-helpers.hxx> +#include <mockup-config.h> + +using namespace std; + +namespace test +{ + void addWsResponse( const char* url, const char* filename, + const char* bodyMatch = 0 ) + { + string outBuf; + loadFromFile( filename, outBuf ); + + string emptyLine = ( "\n\n" ); + size_t pos = outBuf.find( emptyLine ); + string headers = outBuf.substr( 0, pos ); + string body = outBuf.substr( pos + emptyLine.size() ); + + curl_mockup_addResponse( url, "", "POST", body.c_str(), 0, false, + headers.c_str(), bodyMatch ); + } +} diff --git a/qa/libcmis/test-mockup-helpers.hxx b/qa/libcmis/test-mockup-helpers.hxx new file mode 100644 index 0000000..75e854a --- /dev/null +++ b/qa/libcmis/test-mockup-helpers.hxx @@ -0,0 +1,33 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +namespace test +{ + void addWsResponse( const char* url, const char* filename, + const char* bodyMatch = 0 ); +} diff --git a/qa/libcmis/test-onedrive.cxx b/qa/libcmis/test-onedrive.cxx new file mode 100644 index 0000000..b15edd1 --- /dev/null +++ b/qa/libcmis/test-onedrive.cxx @@ -0,0 +1,781 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2014 Mihai Varga <mihai.mv13@gmail.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <string> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <mockup-config.h> + +#include <fstream> + +#include <libcmis/document.hxx> + +#include "onedrive-object.hxx" +#include "onedrive-property.hxx" +#include "onedrive-session.hxx" +#include "oauth2-handler.hxx" + +using namespace std; +using namespace libcmis; + +static const string CLIENT_ID ( "mock-id" ); +static const string CLIENT_SECRET ( "mock-secret" ); +static const string USERNAME( "mock-user" ); +static const string PASSWORD( "mock-password" ); +static const string LOGIN_URL ("https://login/url" ); +static const string LOGIN_URL2 ("https://login2/url" ); +static const string APPROVAL_URL ("https://approval/url" ); +static const string AUTH_URL ( "https://auth/url" ); +static const string TOKEN_URL ( "https://token/url" ); +static const string SCOPE ( "https://scope/url" ); +static const string REDIRECT_URI ("redirect:uri" ); +static const string BASE_URL ( "https://base/url" ); + +typedef std::unique_ptr<OneDriveSession> OneDriveSessionPtr; + +class OneDriveTest : public CppUnit::TestFixture +{ + public: + void sessionAuthenticationTest( ); + void sessionExpiryTokenGetTest( ); + void getRepositoriesTest( ); + void getObjectTypeDocumentTest( ); + void getObjectTypeFolderTest( ); + void getObjectTest( ); + void filePropertyTest( ); + void deleteTest( ); + void updatePropertiesTest( ); + void getFileAllowableActionsTest( ); + void getFolderAllowableActionsTest( ); + void getFolderTest( ); + void getChildrenTest( ); + void moveTest( ); + void getDocumentTest( ); + void getDocumentParentTest( ); + void getContentStreamTest( ); + void setContentStreamTest( ); + void createDocumentTest( ); + void getObjectByPathTest( ); + + CPPUNIT_TEST_SUITE( OneDriveTest ); + CPPUNIT_TEST( sessionAuthenticationTest ); + CPPUNIT_TEST( sessionExpiryTokenGetTest ); + CPPUNIT_TEST( getRepositoriesTest ); + CPPUNIT_TEST( getObjectTypeDocumentTest ); + CPPUNIT_TEST( getObjectTypeFolderTest ); + CPPUNIT_TEST( getObjectTest ); + CPPUNIT_TEST( filePropertyTest ); + CPPUNIT_TEST( deleteTest ); + CPPUNIT_TEST( updatePropertiesTest ); + CPPUNIT_TEST( getFileAllowableActionsTest ); + CPPUNIT_TEST( getFolderAllowableActionsTest ); + CPPUNIT_TEST( getFolderTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( moveTest ); + CPPUNIT_TEST( getDocumentTest ); + CPPUNIT_TEST( getDocumentParentTest ); + CPPUNIT_TEST( getContentStreamTest ); + CPPUNIT_TEST( setContentStreamTest ); + CPPUNIT_TEST( createDocumentTest ); + CPPUNIT_TEST( getObjectByPathTest ); + CPPUNIT_TEST_SUITE_END( ); + + private: + OneDriveSessionPtr getTestSession( string username, string password ); +}; + +OneDriveSessionPtr OneDriveTest::getTestSession( string username, string password ) +{ + libcmis::OAuth2DataPtr oauth2( + new libcmis::OAuth2Data( AUTH_URL, TOKEN_URL, SCOPE, + REDIRECT_URI, CLIENT_ID, CLIENT_SECRET )); + curl_mockup_reset( ); + string empty; + // login, authentication & approval are done manually at the moment, so I'll + // temporarily borrow them from gdrive + //login response + string loginIdentifier = string("scope=") + SCOPE + + string("&redirect_uri=") + REDIRECT_URI + + string("&response_type=code") + + string("&client_id=") + CLIENT_ID; + + curl_mockup_addResponse ( AUTH_URL.c_str(), loginIdentifier.c_str( ), + "GET", DATA_DIR "/gdrive/login1.html", 200, true); + + //authentication email + curl_mockup_addResponse( LOGIN_URL2.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/login2.html", 200, true); + + //authentication password + curl_mockup_addResponse( LOGIN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/gdrive/approve.html", 200, true); + + //approval response + curl_mockup_addResponse( APPROVAL_URL.c_str( ), empty.c_str( ), + "POST", DATA_DIR "/gdrive/authcode.html", 200, true); + + + // token response + curl_mockup_addResponse ( TOKEN_URL.c_str( ), empty.c_str( ), "POST", + DATA_DIR "/onedrive/token-response.json", 200, true ); + + return OneDriveSessionPtr( new OneDriveSession( BASE_URL, username, password, oauth2, false ) ); +} + +void OneDriveTest::sessionAuthenticationTest( ) +{ + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string empty; + + // Check token request + string expectedTokenRequest = + string( "code=AuthCode") + + string( "&client_id=") + CLIENT_ID + + string( "&client_secret=") + CLIENT_SECRET + + string( "&redirect_uri=") + REDIRECT_URI + + string( "&grant_type=authorization_code" ); + + string tokenRequest( curl_mockup_getRequestBody( TOKEN_URL.c_str(), empty.c_str( ), + "POST" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong token request", + expectedTokenRequest, tokenRequest ); + + // Check token + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Wrong access token", + string ( "mock-access-token" ), + session->m_oauth2Handler->getAccessToken( )); + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "Wrong refresh token", + string ("mock-refresh-token"), + session->m_oauth2Handler->getRefreshToken( )); +} + +void OneDriveTest::sessionExpiryTokenGetTest( ) +{ + // Access_token will expire after expires_in seconds, + // We need to use the refresh key to get a new one. + + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + curl_mockup_reset( ); + static const string objectId("aFileId"); + string url = BASE_URL + "/me/skydrive/files/" + objectId; + + // 401 response, token is expired + curl_mockup_addResponse( url.c_str( ),"", "GET", "", 401, false ); + + curl_mockup_addResponse( TOKEN_URL.c_str(), "", + "POST", DATA_DIR "/onedrive/refresh-response.json", 200, true); + try + { + // GET expires, need to refresh then GET again + libcmis::ObjectPtr obj = session->getObject( objectId ); + } + catch ( ... ) + { + if ( session->getHttpStatus( ) == 401 ) + { + // Check if access token is refreshed + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "wrong access token", + string ( "new-access-token" ), + session->m_oauth2Handler->getAccessToken( ) ); + } + } +} + +void OneDriveTest::getRepositoriesTest( ) +{ + curl_mockup_reset( ); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + vector< libcmis::RepositoryPtr > actual = session->getRepositories( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), + actual.size( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong repository found", + string ( "OneDrive" ), + actual.front()->getId( ) ); +} + +void OneDriveTest::getObjectTypeDocumentTest() +{ + curl_mockup_reset( ); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + libcmis::ObjectTypePtr actual = session->getType("cmis:document"); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type ID", string("cmis:document"), + actual->getId() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type queryName", + string("cmis:document"), + actual->getQueryName() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent", string(""), + actual->getParentTypeId() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string("cmis:document"), + actual->getBaseTypeId() ); + + CPPUNIT_ASSERT( actual->getParentType().get() == NULL ); + CPPUNIT_ASSERT_EQUAL( string( "cmis:document" ), + actual->getBaseType()->getId() ); + + CPPUNIT_ASSERT( actual->isCreatable() ); + CPPUNIT_ASSERT( !actual->isVersionable() ); + CPPUNIT_ASSERT( actual->isFileable() ); + CPPUNIT_ASSERT( actual->isQueryable() ); + CPPUNIT_ASSERT( actual->isFulltextIndexed() ); + CPPUNIT_ASSERT_EQUAL( libcmis::ObjectType::Allowed, + actual->getContentStreamAllowed() ); + + map< string, libcmis::PropertyTypePtr > props = actual->getPropertiesTypes(); + + CPPUNIT_ASSERT_MESSAGE( "Missing property cmis:name", + props.find("cmis:name") != props.end() ); + + CPPUNIT_ASSERT_MESSAGE( "Missing property cmis:name", + props.find("cmis:name") != props.end() ); + CPPUNIT_ASSERT_MESSAGE( "Missing property cmis:contentStreamFileName", + props.find("cmis:contentStreamFileName") != props.end() ); + CPPUNIT_ASSERT_MESSAGE( "Missing property cmis:contentStreamLength", + props.find("cmis:contentStreamLength") != props.end() ); +} + +void OneDriveTest::getObjectTypeFolderTest() +{ + curl_mockup_reset( ); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + libcmis::ObjectTypePtr actual = session->getType("cmis:folder"); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type ID", string("cmis:folder"), + actual->getId() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type queryName", + string("cmis:folder"), + actual->getQueryName() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent", string(""), + actual->getParentTypeId() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string("cmis:folder"), + actual->getBaseTypeId() ); + + CPPUNIT_ASSERT( actual->getParentType().get() == NULL ); + CPPUNIT_ASSERT_EQUAL( string( "cmis:folder" ), + actual->getBaseType()->getId() ); + + CPPUNIT_ASSERT( actual->isCreatable() ); + CPPUNIT_ASSERT( !actual->isVersionable() ); + CPPUNIT_ASSERT( actual->isFileable() ); + CPPUNIT_ASSERT( actual->isQueryable() ); + CPPUNIT_ASSERT( !actual->isFulltextIndexed() ); + CPPUNIT_ASSERT_EQUAL( libcmis::ObjectType::NotAllowed, + actual->getContentStreamAllowed() ); + + map< string, libcmis::PropertyTypePtr > props = actual->getPropertiesTypes(); + + CPPUNIT_ASSERT_MESSAGE( "Missing property cmis:name", + props.find("cmis:name") != props.end() ); + CPPUNIT_ASSERT_MESSAGE( "Property cmis:contentStreamFileName shouldn't be set", + props.find("cmis:contentStreamFileName") == props.end() ); + CPPUNIT_ASSERT_MESSAGE( "Property cmis:contentStreamLength shouldn't be set", + props.find("cmis:contentStreamLength") == props.end() ); +} + +void OneDriveTest::getObjectTest() +{ + static const string objectId ("aFileId"); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/" + objectId; + curl_mockup_addResponse ( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + libcmis::ObjectPtr object = session->getObject( objectId ); + boost::shared_ptr<OneDriveObject> obj = boost::dynamic_pointer_cast + <OneDriveObject>( object ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Object Id", objectId, + obj->getId( ) ); +} + +void OneDriveTest::filePropertyTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFileId"); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( objectId ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong creation date", + string ( "2014-06-09T08:24:04+0000" ), + obj->getStringProperty( "cmis:creationDate" ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong object id", + string ( "aFileId" ), + obj->getStringProperty( "cmis:objectId" ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong author", + string ( "onedriveUser" ), + obj->getStringProperty( "cmis:createdBy" ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong file name", + string ( "OneDriveFile" ), + obj->getStringProperty( "cmis:contentStreamFileName" ) ); +} + +void OneDriveTest::deleteTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + const string objectId( "aFileId" ); + + string url = BASE_URL + "/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + curl_mockup_addResponse( url.c_str( ),"", "DELETE", "", 204, false); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + object->remove( ); + const struct HttpRequest* deleteRequest = curl_mockup_getRequest( url.c_str( ), "", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "Delete request not sent", deleteRequest ); + curl_mockup_HttpRequest_free( deleteRequest ); +} + +void OneDriveTest::updatePropertiesTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string objectId( "aFileId" ); + const string newObjectId( "aNewFileId" ); + + const string objectUrl = BASE_URL + "/" + objectId; + const string newObjectUrl = BASE_URL + "/" + newObjectId; + + curl_mockup_addResponse( objectUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true ); + curl_mockup_addResponse( newObjectUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/updated-file.json", 200, true ); + curl_mockup_addResponse( objectUrl.c_str( ), "", + "PUT", DATA_DIR "/onedrive/updated-file.json", 200, true ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::ObjectPtr newObject = session->getObject( newObjectId ); + + object->updateProperties( newObject->getProperties( ) ); + + const char* updateRequest = curl_mockup_getRequestBody( objectUrl.c_str( ), "", "PUT" ); + + Json json = Json::parse( string( updateRequest ) ); + string name = json["name"].toString( ); + string description = json["description"].toString( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Name key not converted", + string( "New File Name"), + name ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Description key not converted", + string( "new description"), + description ); +} + +void OneDriveTest::getFileAllowableActionsTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFileId"); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + boost::shared_ptr< libcmis::AllowableActions > actions = object->getAllowableActions( ); + + CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be true", + actions->isDefined( libcmis::ObjectAction::GetContentStream ) && + actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); + CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be false", + actions->isDefined( libcmis::ObjectAction::CreateDocument ) && + !actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); +} + +void OneDriveTest::getFolderAllowableActionsTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFolderId"); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/folder.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + boost::shared_ptr< libcmis::AllowableActions > actions = object->getAllowableActions( ); + + CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be true", + actions->isDefined( libcmis::ObjectAction::CreateDocument ) && + actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); + + CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be false", + actions->isDefined( libcmis::ObjectAction::GetContentStream ) && + !actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); +} + +void OneDriveTest::getFolderTest( ) +{ + curl_mockup_reset( ); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + static const string folderId( "aFolderId" ); + static const string parentId( "aParentId" ); + string url = BASE_URL + "/" + folderId; + string parentUrl = BASE_URL + "/" + parentId; + + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/folder.json", 200, true); + + curl_mockup_addResponse( parentUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/parent-folder.json", 200, true); + + libcmis::FolderPtr folder = session->getFolder( folderId ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::FolderPtr", + NULL != folder ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", folderId, folder->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "OneDrive Folder" ), folder->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), folder->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "Missing folder parent", folder->getFolderParent( ).get( ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !folder->isRootFolder() ); + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !folder->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !folder->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !folder->getLastModificationDate( ).is_not_a_date_time() ); +} + +void OneDriveTest::getChildrenTest( ) +{ + curl_mockup_reset( ); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + static const string folderId ("aFolderId"); + string url = BASE_URL + "/" + folderId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/folder.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( folderId ); + + libcmis::FolderPtr folder = session->getFolder( folderId ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::FolderPtr", + NULL != folder ); + + string childrenUrl = BASE_URL + "/" + folderId + "/files"; + curl_mockup_addResponse( childrenUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/folder-listed.json", 200, true); + + vector< libcmis::ObjectPtr > children= folder->getChildren( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of children", size_t( 2 ), children.size() ); + + int folderCount = 0; + int fileCount = 0; + for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); + it != children.end( ); ++it ) + { + if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) + ++folderCount; + else + ++fileCount; + } + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 1, folderCount ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of file children", 1, fileCount ); +} + +void OneDriveTest::moveTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string objectId( "aFileId" ); + const string sourceId( "aFolderId" ); + const string desId( "aParentId" ); + + string url = BASE_URL + "/" + objectId; + string sourceUrl = BASE_URL + "/" + sourceId; + string desUrl = BASE_URL + "/" + desId; + + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true ); + curl_mockup_addResponse( url.c_str( ), "method=MOVE", + "POST", DATA_DIR "/onedrive/file.json", 200, true ); + curl_mockup_addResponse( desUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/parent-folder.json", 200, true ); + curl_mockup_addResponse( sourceUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/folder.json", 200, true ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::FolderPtr source = session->getFolder( sourceId ); + libcmis::FolderPtr destination = session->getFolder( desId ); + + object->move( source, destination ); + const char* moveRequest = curl_mockup_getRequestBody( url.c_str( ), "method=MOVE", "POST" ); + Json parentJson = Json::parse( string( moveRequest ) ); + string newParentId = parentJson["destination"].toString( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad new parent folder", desId, newParentId); +} + +void OneDriveTest::getDocumentTest( ) +{ + curl_mockup_reset( ); + static const string objectId ("aFileId"); + + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string url = BASE_URL + "/" + objectId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + + libcmis::ObjectPtr obj = session->getObject( objectId ); + + // Check if we got the document object. + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( obj ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); + + // Test the document properties + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", objectId, document->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", + string( "OneDriveFile" ), + document->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); + + CPPUNIT_ASSERT_MESSAGE( "Content length is incorrect", 42 == document->getContentLength( ) ); +} + +void OneDriveTest::getDocumentParentTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + static const string documentId( "aFileId" ); + static const string parentId( "aParentId" ); + string url = BASE_URL + "/" + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + + string parentUrl = BASE_URL + "/" + parentId; + curl_mockup_addResponse( parentUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/parent-folder.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( "aFileId" ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + CPPUNIT_ASSERT_MESSAGE( "Document expected", document != NULL ); + + vector< libcmis::FolderPtr > parents= document->getParents( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 1 ), parents.size() ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent Id", parentId, parents[0]->getId( ) ); +} + +void OneDriveTest::getContentStreamTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + static const string documentId( "aFileId" ); + string url = BASE_URL + "/" + documentId; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + string expectedContent( "Test content stream" ); + string downloadUrl = "sourceUrl"; + curl_mockup_addResponse( downloadUrl.c_str( ), "", "GET", expectedContent.c_str( ), 0, false ); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + try + { + boost::shared_ptr< istream > is = document->getContentStream( ); + ostringstream out; + out << is->rdbuf(); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", expectedContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void OneDriveTest::setContentStreamTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + const string documentId( "aFileId" ); + + string url = BASE_URL + "/" + documentId; + string putUrl = BASE_URL + "/aParentId/files/OneDriveFile"; + curl_mockup_addResponse( url.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( documentId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + curl_mockup_addResponse( url.c_str( ), "", + "PUT", DATA_DIR "/onedrive/file.json", 200, true); + curl_mockup_addResponse( putUrl.c_str( ), "overwrite=true", "PUT", "Updated", 0, false ); + try + { + string expectedContent( "Test set content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "aFileName" ); + document->setContentStream( os, "text/plain", filename ); + + CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); + + // Check if metadata has been properly uploaded + const char* meta = curl_mockup_getRequestBody( url.c_str( ), "", "PUT" ); + string expectedMeta = "{\n \"name\": \"aFileName\"\n}\n"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad meta uploaded", expectedMeta, string( meta ) ); + // Check the content has been properly uploaded + const char* content = curl_mockup_getRequestBody( putUrl.c_str( ), "", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void OneDriveTest::createDocumentTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string documentId( "aFileId" ); + const string folderId( "aParentId" ); + const string filename( "aFileName" ); + + const string folderUrl = BASE_URL + "/" + folderId; + const string uploadUrl = folderUrl + "/files/" + filename; + const string documentUrl = BASE_URL + "/" + documentId; + + curl_mockup_addResponse( folderUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/parent-folder.json", 200, true ); + curl_mockup_addResponse( uploadUrl.c_str( ), "", + "PUT", DATA_DIR "/onedrive/new-file.json", 200, true ); + curl_mockup_addResponse( documentUrl.c_str( ), "", + "PUT", DATA_DIR "/onedrive/file.json", 200, true ); + curl_mockup_addResponse( documentUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/file.json", 200, true ); + + libcmis::FolderPtr parent = session->getFolder( folderId ); + try + { + string expectedContent( "Test set content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + PropertyPtrMap properties; + + parent->createDocument( properties, os, "text/plain", filename ); + + curl_mockup_getRequestBody( documentUrl.c_str( ), "", "PUT" ); + const char* content = curl_mockup_getRequestBody( uploadUrl.c_str( ), "", "PUT" ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what( ); + CPPUNIT_FAIL( msg.c_str( ) ); + } +} + +void OneDriveTest::getObjectByPathTest( ) +{ + curl_mockup_reset( ); + OneDriveSessionPtr session = getTestSession( USERNAME, PASSWORD ); + const string documentId( "rightFile" ); + const string wrongDocumentId( "wrongFile" ); + const string folderAId( "folderA" ); // root + const string folderBId( "folderB" ); + const string folderCId( "folderC" ); + const string path( "/Folder B/Folder C/OneDriveFile" ); + + const string documentUrl = BASE_URL + "/" + documentId; + const string wrongDocumentUrl = BASE_URL + "/" + wrongDocumentId; + const string folderAUrl = BASE_URL + "/" + folderAId; + const string folderBUrl = BASE_URL + "/" + folderBId; + const string folderCUrl = BASE_URL + "/" + folderCId; + const string searchUrl = BASE_URL + "/me/skydrive/search"; + + curl_mockup_addResponse( documentUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/searched-file.json", 200, true ); + curl_mockup_addResponse( wrongDocumentUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/searched-wrong-file.json", 200, true ); + curl_mockup_addResponse( searchUrl.c_str( ), "q=OneDriveFile", + "GET", DATA_DIR "/onedrive/search-result.json", 200, true ); + curl_mockup_addResponse( folderAUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/folderA.json", 200, true ); + curl_mockup_addResponse( folderBUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/folderB.json", 200, true ); + curl_mockup_addResponse( folderCUrl.c_str( ), "", + "GET", DATA_DIR "/onedrive/folderC.json", 200, true ); + + libcmis::ObjectPtr object = session->getObjectByPath( path ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong objectFetched", documentId, object->getId( ) ); +} + +CPPUNIT_TEST_SUITE_REGISTRATION( OneDriveTest ); diff --git a/qa/libcmis/test-sharepoint.cxx b/qa/libcmis/test-sharepoint.cxx new file mode 100644 index 0000000..91a2367 --- /dev/null +++ b/qa/libcmis/test-sharepoint.cxx @@ -0,0 +1,733 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2014 Mihai Varga <mihai.mv13@gmail.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#include <string> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <mockup-config.h> + +#include <fstream> +#include "test-helpers.hxx" +#include "sharepoint-document.hxx" +#include "sharepoint-object.hxx" +#include "sharepoint-property.hxx" +#include "sharepoint-session.hxx" + +using namespace std; +using namespace libcmis; + +static const string USERNAME( "mock-user" ); +static const string PASSWORD( "mock-password" ); +static const string BASE_URL( "http://base/_api/Web" ); +static const string CONTEXTINFO_URL( "http://base/_api/contextinfo" ); + +typedef std::unique_ptr<SharePointSession> SharePointSessionPtr; + +class SharePointTest : public CppUnit::TestFixture +{ + public: + void setRepositoryTest( ); + void getRepositoriesTest( ); + void getObjectTest( ); + void propertiesTest( ); + void deleteTest( ); + void xdigestExpiredTest( ); + void getFileAllowableActionsTest( ); + void getFolderAllowableActionsTest( ); + void getDocumentTest( ); + void getContentStreamTest( ); + void setContentStreamTest( ); + void checkOutTest( ); + void checkInTest( ); + void getAllVersionsTest( ); + void getFolderTest( ); + void getChildrenTest( ); + void createFolderTest( ); + void createDocumentTest( ); + void moveTest( ); + void getObjectByPathTest( ); + + void propertyCopyTest( ); + void objectCopyTest( ); + + CPPUNIT_TEST_SUITE( SharePointTest ); + CPPUNIT_TEST( setRepositoryTest ); + CPPUNIT_TEST( getRepositoriesTest ); + CPPUNIT_TEST( getObjectTest ); + CPPUNIT_TEST( propertiesTest ); + CPPUNIT_TEST( deleteTest ); + CPPUNIT_TEST( xdigestExpiredTest ); + CPPUNIT_TEST( getFileAllowableActionsTest ); + CPPUNIT_TEST( getFolderAllowableActionsTest ); + CPPUNIT_TEST( getDocumentTest ); + CPPUNIT_TEST( getContentStreamTest ); + CPPUNIT_TEST( setContentStreamTest ); + CPPUNIT_TEST( checkOutTest ); + CPPUNIT_TEST( checkInTest ); + CPPUNIT_TEST( getAllVersionsTest ); + CPPUNIT_TEST( getFolderTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( createFolderTest ); + CPPUNIT_TEST( createDocumentTest ); + CPPUNIT_TEST( moveTest ); + CPPUNIT_TEST( getObjectByPathTest ); + CPPUNIT_TEST( propertyCopyTest ); + CPPUNIT_TEST( objectCopyTest ); + CPPUNIT_TEST_SUITE_END( ); + + private: + SharePointSessionPtr getTestSession( string username, string password ); +}; + +SharePointSessionPtr SharePointTest::getTestSession( string username, string password ) +{ + curl_mockup_reset( ); + curl_mockup_addResponse( BASE_URL.c_str( ), "", "GET", "", 401, false ); + curl_mockup_addResponse( ( BASE_URL + "/currentuser" ).c_str( ), "", "GET", + DATA_DIR "/sharepoint/auth-resp.json", 200, true ); + curl_mockup_addResponse( CONTEXTINFO_URL.c_str( ), "", "POST", + DATA_DIR "/sharepoint/xdigest.json", 200, true ); + + return SharePointSessionPtr( new SharePointSession( BASE_URL, username, password, false ) ); +} + +void SharePointTest::setRepositoryTest( ) +{ + curl_mockup_reset( ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + CPPUNIT_ASSERT_MESSAGE( "setRepository should never fail", session->setRepository( "Anything" )); +} + +void SharePointTest::getRepositoriesTest( ) +{ + curl_mockup_reset( ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + vector< libcmis::RepositoryPtr > actual = session->getRepositories( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), + actual.size( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong repository found", + string ( "SharePoint" ), + actual.front()->getId( ) ); +} + +void SharePointTest::getObjectTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + boost::shared_ptr<SharePointObject> obj = boost::dynamic_pointer_cast + <SharePointObject>( object ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Object Id", objectId, + obj->getId( ) ); +} + +void SharePointTest::propertiesTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong creation date", + string ( "2014-07-08T09:29:29Z" ), + object->getStringProperty( "cmis:creationDate" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong object id", + string ( "http://base/_api/Web/aFileId" ), + object->getStringProperty( "cmis:objectId" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong author", + string ( "aUserId" ), + object->getStringProperty( "cmis:createdBy" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong file name", + string ( "SharePointFile" ), + object->getStringProperty( "cmis:contentStreamFileName" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong checkin comment", + string ( "aCheckinComment" ), + object->getStringProperty( "cmis:checkinComment" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong version", + string ( "1.0" ), + object->getStringProperty( "cmis:versionLabel" ) ); +} + +void SharePointTest::deleteTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse( objectId.c_str( ),"", "DELETE", "", 204, false); + + libcmis::ObjectPtr object = session->getObject( objectId ); + + object->remove( ); + const struct HttpRequest* deleteRequest = curl_mockup_getRequest( objectId.c_str( ), "", "DELETE" ); + CPPUNIT_ASSERT_MESSAGE( "Delete request not sent", deleteRequest ); + curl_mockup_HttpRequest_free( deleteRequest ); +} + +void SharePointTest::xdigestExpiredTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse( objectId.c_str( ),"", "DELETE", "", 401, false); + curl_mockup_addResponse( CONTEXTINFO_URL.c_str( ), "", "POST", + DATA_DIR "/sharepoint/new-xdigest.json", 200, true ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + try + { + object->remove( ); + } + catch ( ... ) + { + if ( session->getHttpStatus( ) == 401 ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( + "wrong xdigest code", + string ( "new-xdigest-code" ), + session->m_digestCode ); + } + } +} + +void SharePointTest::getFileAllowableActionsTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + boost::shared_ptr< libcmis::AllowableActions > actions = object->getAllowableActions( ); + + CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be true", + actions->isDefined( libcmis::ObjectAction::GetContentStream ) && + actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); + CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be false", + actions->isDefined( libcmis::ObjectAction::CreateDocument ) && + !actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); +} + +void SharePointTest::getFolderAllowableActionsTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFolderId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string folderPropUrl = objectId + "/Properties"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder.json", 200, true); + curl_mockup_addResponse ( folderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + boost::shared_ptr< libcmis::AllowableActions > actions = object->getAllowableActions( ); + + CPPUNIT_ASSERT_MESSAGE( "CreateDocument allowable action should be true", + actions->isDefined( libcmis::ObjectAction::CreateDocument ) && + actions->isAllowed( libcmis::ObjectAction::CreateDocument ) ); + + CPPUNIT_ASSERT_MESSAGE( "GetContentStream allowable action should be false", + actions->isDefined( libcmis::ObjectAction::GetContentStream ) && + !actions->isAllowed( libcmis::ObjectAction::GetContentStream ) ); +} + +void SharePointTest::getDocumentTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + // Check if we got the document object. + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); + + // Test the document properties + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", objectId, document->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", + string( "SharePointFile" ), + document->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "Content length is incorrect", 18045 == document->getContentLength( ) ); +} + +void SharePointTest::getContentStreamTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + string expectedContent( "Test content stream" ); + string downloadUrl = objectId + "/%24value"; + + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse( downloadUrl.c_str( ), "", "GET", expectedContent.c_str( ), 0, false ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + try + { + boost::shared_ptr< istream > is = document->getContentStream( ); + ostringstream out; + out << is->rdbuf(); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", expectedContent, out.str( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void SharePointTest::setContentStreamTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + string expectedContent( "Test content stream" ); + string putUrl = objectId + "/%24value"; + + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse( putUrl.c_str( ), "", "PUT", "Updated", 0, false ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + try + { + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "aFileName" ); + document->setContentStream( os, "text/plain", filename ); + + CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); + // Check the content has been properly uploaded + const char* content = curl_mockup_getRequestBody( putUrl.c_str( ), "", "PUT" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void SharePointTest::checkOutTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + static const string authorUrl = objectId + "/Author"; + static const string checkOutUrl = objectId + "/checkout"; + static const string cancelCheckOutUrl = objectId + "/undocheckout"; + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + curl_mockup_addResponse( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true ); + curl_mockup_addResponse( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true ); + curl_mockup_addResponse( checkOutUrl.c_str( ), "", + "POST", DATA_DIR "/sharepoint/file.json", 200, true ); + curl_mockup_addResponse( cancelCheckOutUrl.c_str( ), "", + "POST", DATA_DIR "/sharepoint/file.json", 200, true ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + libcmis::DocumentPtr checkedOutDocument = document->checkOut( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong checkedOut document", + objectId, + checkedOutDocument->getId( ) ); + + checkedOutDocument->cancelCheckout( ); +} + +void SharePointTest::checkInTest( ) +{ + static const string objectId( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + string expectedContent( "Test content stream" ); + string putUrl = objectId + "/%24value"; + string checkInUrl = objectId + "/checkin(comment='checkin_comment',checkintype=1)"; + + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse( putUrl.c_str( ), "", "PUT", "Updated", 0, false ); + curl_mockup_addResponse( checkInUrl.c_str( ), "", + "POST", DATA_DIR "/sharepoint/file.json", 200, true ); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + PropertyPtrMap properties; + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string fileName( "aFileName" ); + string checkInComment( "checkin_comment" ); + + libcmis::DocumentPtr checkedInDocument; + checkedInDocument = document->checkIn( true, checkInComment, properties, os, "", fileName ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong checkedIn document", objectId, checkedInDocument->getId( ) ); +} + +void SharePointTest::getAllVersionsTest( ) +{ + static const string objectId( "http://base/_api/Web/aFileId" ); + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + string versionsUrl = objectId + "/Versions"; + string objectV1Url = versionsUrl +"(1)"; + string objectV2Url = versionsUrl +"(2)"; + string objectV1Id = objectId + "-v1"; + + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse ( versionsUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/versions.json", 200, true); + curl_mockup_addResponse ( objectV1Url.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( objectV2Url.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file-v1.json", 200, true); + + libcmis::ObjectPtr object = session->getObject( objectId ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + vector< libcmis::DocumentPtr > allVersions = document->getAllVersions( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong version of the document - 1", + objectId, allVersions[1]->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong version of the document - 2", + objectV1Id, allVersions[2]->getId( ) ); +} + +void SharePointTest::getFolderTest( ) +{ + static const string folderId( "http://base/_api/Web/aFolderId" ); + static const string parentId( "http://base/_api/Web/rootFolderId" ); + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + string parentUrl = folderId + "/ParentFolder"; + string folderPropUrl = folderId + "/Properties"; + string parentFolderPropUrl = parentId + "/Properties"; + curl_mockup_addResponse( folderId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder.json", 200, true ); + curl_mockup_addResponse( folderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( parentFolderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( parentUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/root-folder.json", 200, true ); + curl_mockup_addResponse( parentId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/root-folder.json", 200, true ); + + libcmis::FolderPtr folder = session->getFolder( folderId ); + + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::FolderPtr", + NULL != folder ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", folderId, folder->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "SharePointFolder" ), folder->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), folder->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "Missing folder parent", folder->getFolderParent( ).get( ) ); + CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !folder->isRootFolder() ); +} + +void SharePointTest::getChildrenTest( ) +{ + static const string folderId( "http://base/_api/Web/aFolderId" ); + static const string authorUrl( "http://base/_api/Web/aFileId/Author" ); + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + string filesUrl = folderId + "/Files"; + string foldersUrl = folderId + "/Folders"; + string folderPropUrl = folderId + "/Properties"; + curl_mockup_addResponse( folderId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder.json", 200, true ); + curl_mockup_addResponse( folderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( filesUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/children-files.json", 200, true ); + curl_mockup_addResponse( foldersUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/children-folders.json", 200, true ); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + libcmis::FolderPtr folder = session->getFolder( folderId ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::FolderPtr", + NULL != folder ); + + vector< libcmis::ObjectPtr > children= folder->getChildren( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of children", size_t( 2 ), children.size() ); + + int folderCount = 0; + int fileCount = 0; + for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); + it != children.end( ); ++it ) + { + if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) + ++folderCount; + else { + ++fileCount; + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( *it ); + vector< libcmis::FolderPtr > parents= document->getParents( ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 1 ), parents.size() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong parent Id", folderId, parents[0]->getId( ) ); + } + + } + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 1, folderCount ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of file children", 1, fileCount ); +} + +void SharePointTest::createFolderTest( ) +{ + static const string folderId( "http://base/_api/Web/aFolderId" ); + static const string parentId( "http://base/_api/Web/rootFolderId" ); + static const string newFolderUrl ( "http://base/_api/Web/folders/add('/SharePointFolder')" ); + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + string folderPropUrl = folderId + "/Properties"; + string parentFolderPropUrl = parentId + "/Properties"; + curl_mockup_addResponse( folderId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder.json", 200, true ); + curl_mockup_addResponse( folderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( parentFolderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( parentId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/root-folder.json", 200, true ); + curl_mockup_addResponse( newFolderUrl.c_str( ), "", + "POST", DATA_DIR "/sharepoint/folder.json", 200, true ); + + libcmis::FolderPtr folder = session->getFolder( parentId ); + PropertyPtrMap properties = session->getFolder( folderId )->getProperties( ); + + libcmis::FolderPtr newFolder = folder->createFolder( properties ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "New folder not created", folderId, newFolder->getId( ) ); +} + +void SharePointTest::createDocumentTest( ) +{ + static const string folderId( "http://base/_api/Web/aFolderId" ); + static const string fileId( "http://base/_api/Web/aFileId" ); + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + + string folderPropUrl = folderId + "/Properties"; + string newDocUrl = folderId + "/files/add(overwrite=true,url='NewDoc')"; + string authorUrl = fileId + "/Author"; + curl_mockup_addResponse( folderId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder.json", 200, true ); + curl_mockup_addResponse( folderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( newDocUrl.c_str( ), "", + "POST", DATA_DIR "/sharepoint/file.json", 200, true ); + curl_mockup_addResponse( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true ); + + libcmis::FolderPtr folder = session->getFolder( folderId ); + try + { + string expectedContent( "Test set content stream" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + PropertyPtrMap properties; + string fileName = "NewDoc"; + + libcmis::DocumentPtr document = folder->createDocument( properties, os, + "text/plain", fileName ); + + const char* content = curl_mockup_getRequestBody( newDocUrl.c_str( ), "", "POST" ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad content uploaded", expectedContent, string( content ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad document id", fileId, document->getId( ) ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what( ); + CPPUNIT_FAIL( msg.c_str( ) ); + } +} + +void SharePointTest::moveTest( ) +{ + static const string fileId ( "http://base/_api/Web/aFileId" ); + static const string folderId( "http://base/_api/Web/aFolderId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = fileId + "/Author"; + string folderPropUrl = folderId + "/Properties"; + string moveUrl = fileId + "/moveto(newurl='/SharePointFolder/SharePointFile',flags=1)"; + curl_mockup_addResponse ( fileId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + curl_mockup_addResponse ( folderId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder.json", 200, true); + curl_mockup_addResponse( folderPropUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/folder-properties.json", 200, true ); + curl_mockup_addResponse( moveUrl.c_str( ), "", + "POST", DATA_DIR "/sharepoint/file.json", 200, true ); + + libcmis::ObjectPtr document = session->getObject( fileId ); + libcmis::FolderPtr folder = session->getFolder( folderId ); + + document->move( folder, folder ); + // nothing to assert, making the right reqeusts should be enough +} + +void SharePointTest::getObjectByPathTest( ) +{ + static const string folderUrl( "http://base/_api/Web/getFolderByServerRelativeUrl('/SharePointFile')" ); + static const string fileUrl( "http://base/_api/Web/getFileByServerRelativeUrl('/SharePointFile')" ); + static string authorUrl( "http://base/_api/Web/aFileId/Author" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + curl_mockup_addResponse( fileUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse( folderUrl.c_str( ), "", + "GET", "", 400, true); + curl_mockup_addResponse( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + libcmis::ObjectPtr object = session->getObjectByPath( "/SharePointFile" ); + // Check if we got the document object. + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); +} + +void SharePointTest::propertyCopyTest( ) +{ + SharePointProperty property("Author", + "\"__deferred\":{" + " \"uri\":\"http://base/_api/Web/aFileId/Author\"" + "}"); + + { + SharePointProperty copy; + copy = property; + + CPPUNIT_ASSERT_EQUAL( property.m_propertyType->m_id, copy.m_propertyType->m_id ); + CPPUNIT_ASSERT_EQUAL( property.m_strValues[0], copy.m_strValues[0]); + } + + { + SharePointProperty copy( property ); + + CPPUNIT_ASSERT_EQUAL( property.m_propertyType->m_id, copy.m_propertyType->m_id ); + CPPUNIT_ASSERT_EQUAL( property.m_strValues[0], copy.m_strValues[0]); + } +} + +void SharePointTest::objectCopyTest( ) +{ + static const string objectId ( "http://base/_api/Web/aFileId" ); + + SharePointSessionPtr session = getTestSession( USERNAME, PASSWORD ); + string authorUrl = objectId + "/Author"; + curl_mockup_addResponse ( objectId.c_str( ), "", + "GET", DATA_DIR "/sharepoint/file.json", 200, true); + curl_mockup_addResponse ( authorUrl.c_str( ), "", + "GET", DATA_DIR "/sharepoint/author.json", 200, true); + + boost::shared_ptr< SharePointObject > object = boost::dynamic_pointer_cast< SharePointObject >(session->getObject( objectId ) ); + + { + SharePointObject copy( *object ); + CPPUNIT_ASSERT_EQUAL( object->m_refreshTimestamp, copy.m_refreshTimestamp ); + } + + { + SharePointObject copy( session.get( ) ); + copy = *object; + CPPUNIT_ASSERT_EQUAL( object->m_refreshTimestamp, copy.m_refreshTimestamp ); + } +} + +CPPUNIT_TEST_SUITE_REGISTRATION( SharePointTest ); diff --git a/qa/libcmis/test-soap.cxx b/qa/libcmis/test-soap.cxx new file mode 100644 index 0000000..e401971 --- /dev/null +++ b/qa/libcmis/test-soap.cxx @@ -0,0 +1,563 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> +#include <cppunit/ui/text/TestRunner.h> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include "ws-relatedmultipart.hxx" +#include "ws-requests.hxx" +#include "ws-soap.hxx" +#include "test-helpers.hxx" + +using namespace std; + +class SoapTest : public CppUnit::TestFixture +{ + private: + map< string, SoapResponseCreator > getTestMapping( ); + map< string, string > getTestNamespaces( ); + map< string, SoapFaultDetailCreator > getTestDetailMapping( ); + + public: + + // Copy tests + void soapResponseFactoryCopyTest(); + + // Soap Responses tests + + void createResponseTest( ); + void parseFaultDetailEmptyTest( ); + void parseFaultDetailUnknownTest( ); + void parseFaultDetailValidTest( ); + void createFaultDefaultTest( ); + void parseResponseTest( ); + void parseResponseXmlTest( ); + void parseResponseFaultTest( ); + + // RelatedMultipart tests + + void serializeMultipartSimpleTest( ); + void serializeMultipartComplexTest( ); + void parseMultipartTest( ); + void getStreamFromNodeXopTest( ); + void getStreamFromNodeBase64Test( ); + + // CMISM utilities tests + void writeCmismStreamTest( ); + + CPPUNIT_TEST_SUITE( SoapTest ); + CPPUNIT_TEST( soapResponseFactoryCopyTest ); + + CPPUNIT_TEST( createResponseTest ); + CPPUNIT_TEST( parseFaultDetailEmptyTest ); + CPPUNIT_TEST( parseFaultDetailUnknownTest ); + CPPUNIT_TEST( parseFaultDetailValidTest ); + CPPUNIT_TEST( parseResponseTest ); + CPPUNIT_TEST( parseResponseXmlTest ); + CPPUNIT_TEST( parseResponseFaultTest ); + + CPPUNIT_TEST( serializeMultipartSimpleTest ); + CPPUNIT_TEST( serializeMultipartComplexTest ); + CPPUNIT_TEST( parseMultipartTest ); + CPPUNIT_TEST( getStreamFromNodeXopTest ); + CPPUNIT_TEST( getStreamFromNodeBase64Test ); + + CPPUNIT_TEST( writeCmismStreamTest ); + + CPPUNIT_TEST_SUITE_END( ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( SoapTest ); + +/** Dummy response class to use for testing + */ +class TestResponse : public SoapResponse +{ + private: + TestResponse( ) { }; + + public: + + static SoapResponsePtr create( xmlNodePtr, RelatedMultipart&, SoapSession* ) + { + SoapResponsePtr resp ( new TestResponse( ) ); + return resp; + } +}; + +class TestFaultDetail : public SoapFaultDetail +{ + private: + TestFaultDetail( ) : SoapFaultDetail( ) { }; + + public: + ~TestFaultDetail( ) noexcept { }; + + static SoapFaultDetailPtr create( xmlNodePtr ) + { + return SoapFaultDetailPtr( new TestFaultDetail( ) ); + } +}; + +map< string, SoapResponseCreator > SoapTest::getTestMapping( ) +{ + map< string, SoapResponseCreator > mapping; + mapping[ "{test-ns-url}testResponse" ] = &TestResponse::create; + return mapping; +} + +map< string, SoapFaultDetailCreator > SoapTest::getTestDetailMapping( ) +{ + map< string, SoapFaultDetailCreator > mapping; + mapping[ "{test-ns-url}testFault" ] = &TestFaultDetail::create; + return mapping; +} + +map< string, string > SoapTest::getTestNamespaces( ) +{ + map< string, string > namespaces; + namespaces[ "test" ] = "test-ns-url"; + return namespaces; +} + +void SoapTest::soapResponseFactoryCopyTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + { + SoapResponseFactory copy; + copy = factory; + + CPPUNIT_ASSERT_EQUAL( factory.m_mapping.size(), copy.m_mapping.size() ); + CPPUNIT_ASSERT_EQUAL( factory.m_namespaces.size(), copy.m_namespaces.size() ); + CPPUNIT_ASSERT_EQUAL( factory.m_detailMapping.size(), copy.m_detailMapping.size() ); + CPPUNIT_ASSERT_EQUAL( factory.m_session, copy.m_session ); + } + + { + SoapResponseFactory copy( factory ); + + CPPUNIT_ASSERT_EQUAL( factory.m_mapping.size(), copy.m_mapping.size() ); + CPPUNIT_ASSERT_EQUAL( factory.m_namespaces.size(), copy.m_namespaces.size() ); + CPPUNIT_ASSERT_EQUAL( factory.m_detailMapping.size(), copy.m_detailMapping.size() ); + CPPUNIT_ASSERT_EQUAL( factory.m_session, copy.m_session ); + } +} + +void SoapTest::createResponseTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<n1:testResponse xmlns:n1=\"test-ns-url\"/>"; + RelatedMultipart multipart; // Multipart won't be used in that test + + SoapResponsePtr actual = factory.createResponse( test::getXmlNode( xml ), multipart ); + CPPUNIT_ASSERT_MESSAGE( "Wrong response created", dynamic_cast< TestResponse* >( actual.get( ) ) != NULL ); +} + +void SoapTest::parseFaultDetailEmptyTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<detail/>"; + + vector< SoapFaultDetailPtr > actual = factory.parseFaultDetail( test::getXmlNode( xml ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Shouldn't have any detail", size_t( 0 ), actual.size() ); +} + +void SoapTest::parseFaultDetailUnknownTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<detail><unknown-detail/></detail>"; + + vector< SoapFaultDetailPtr > actual = factory.parseFaultDetail( test::getXmlNode( xml ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Shouldn't have ignored unknonw details", size_t( 0 ), actual.size() ); +} +void SoapTest::parseFaultDetailValidTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<detail><n1:testFault xmlns:n1=\"test-ns-url\"/></detail>"; + + vector< SoapFaultDetailPtr > actual = factory.parseFaultDetail( test::getXmlNode( xml ) ); + CPPUNIT_ASSERT_MESSAGE( "Wrong fault detail created", + dynamic_cast< TestFaultDetail* >( actual.front( ).get( ) ) != NULL ); +} + +void SoapTest::parseResponseTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body>" + "<test:testResponse xmlns:test=\"test-ns-url\"/>" + "<test:testResponse xmlns:test=\"test-ns-url\"/>" + "</S:Body></S:Envelope>"; + string name( "name" ); + string type( "application/xop+xml" ); + RelatedPartPtr requestPart( new RelatedPart( name, type, xml ) ); + + RelatedMultipart multipart; + string cid = multipart.addPart( requestPart ); + string startInfo( "text/xml" ); + multipart.setStart( cid, startInfo ); + + vector< SoapResponsePtr > actual = factory.parseResponse( multipart ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of responses", size_t( 2 ), actual.size( ) ); +} + +void SoapTest::parseResponseXmlTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body>" + "<test:testResponse xmlns:test=\"test-ns-url\"/>" + "<test:testResponse xmlns:test=\"test-ns-url\"/>" + "</S:Body></S:Envelope>"; + + vector< SoapResponsePtr > actual = factory.parseResponse( xml ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of responses", size_t( 2 ), actual.size( ) ); +} + +void SoapTest::parseResponseFaultTest( ) +{ + SoapResponseFactory factory; + factory.setMapping( getTestMapping() ); + factory.setNamespaces( getTestNamespaces( ) ); + factory.setDetailMapping( getTestDetailMapping( ) ); + + string xml = "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"" + " xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\"" + " xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\">" + " <S:Body><S:Fault>" + " <faultcode xsi:type=\"xsd:string\">S:Client</faultcode>" + " <faultstring xsi:type=\"xsd:string\">Some Error Message</faultstring>" + " <detail><n1:testFault xmlns:n1=\"test-ns-url\"/></detail>" + " </S:Fault></S:Body>" + "</S:Envelope>"; + + string name( "name" ); + string type( "application/xop+xml" ); + RelatedPartPtr requestPart( new RelatedPart( name, type, xml ) ); + + RelatedMultipart multipart; + string cid = multipart.addPart( requestPart ); + string startInfo( "text/xml" ); + multipart.setStart( cid, startInfo ); + + try + { + factory.parseResponse( multipart ); + CPPUNIT_FAIL( "Should have thrown the SoapFault" ); + } + catch ( const SoapFault& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong detail string", string( "Some Error Message" ), e.getFaultstring() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong detail string", string( "Client" ), e.getFaultcode() ); + CPPUNIT_ASSERT_MESSAGE( "Wrong fault detail created", + dynamic_cast< TestFaultDetail* >( e.getDetail( ).front( ).get( ) ) != NULL ); + } +} + +void SoapTest::serializeMultipartSimpleTest( ) +{ + string partName = "data"; + string partType = "text/plain"; + string partContent = "Some content"; + string startInfo = "some info"; + + + RelatedMultipart multipart; + RelatedPartPtr part( new RelatedPart( partName, partType, partContent ) ); + string cid = multipart.addPart( part ); + multipart.setStart( cid, startInfo ); + + boost::shared_ptr< istringstream > actual = multipart.toStream( ); + + string boundary = multipart.getBoundary( ); + string expected = "\r\n--" + boundary + "\r\n" + + "Content-Id: <" + cid + ">\r\n" + + "Content-Type: " + partType + "\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + partContent + + "\r\n--" + boundary + "--\r\n"; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong body", expected, actual->str() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content type", + "multipart/related;start=\"" + cid + "\";type=\"" + partType + "\";boundary=\"" + boundary + "\";start-info=\"" + startInfo + "\"", + multipart.getContentType() ); +} + +void SoapTest::serializeMultipartComplexTest( ) +{ + string rootName = "root"; + string rootType = "text/plain"; + string rootContent = "Some content"; + + string part2Name = "part2"; + string part2Type = "application/octet-stream"; + string part2Content = "Some content 2"; + + string startInfo = "some info"; + + + RelatedMultipart multipart; + RelatedPartPtr rootPart( new RelatedPart( rootName, rootType, rootContent ) ); + string rootCid = multipart.addPart( rootPart ); + + RelatedPartPtr part2( new RelatedPart( part2Name, part2Type, part2Content ) ); + string part2Cid = multipart.addPart( part2 ); + + multipart.setStart( rootCid, startInfo ); + + boost::shared_ptr< istringstream > actual = multipart.toStream( ); + + string boundary = multipart.getBoundary( ); + string expected = "\r\n--" + boundary + "\r\n" + + "Content-Id: <" + rootCid + ">\r\n" + + "Content-Type: " + rootType + "\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + rootContent + + "\r\n--" + boundary + "\r\n" + + "Content-Id: <" + part2Cid + ">\r\n" + + "Content-Type: " + part2Type + "\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + part2Content + + "\r\n--" + boundary + "--\r\n"; + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong body", expected, actual->str() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong content type", + "multipart/related;start=\"" + rootCid + "\";type=\"" + rootType + "\";boundary=\"" + boundary + "\";start-info=\"" + startInfo + "\"", + multipart.getContentType() ); +} + +void SoapTest::parseMultipartTest( ) +{ + string rootCid = "root-cid"; + string rootType = "text/plain"; + string rootContent = "Some content"; + + string part2Cid = "part2-cid"; + string part2Type = "application/octet-stream"; + string part2Content = "Some content 2\r\nwith windows-style line endings\r\n"; + + string startInfo = "some info"; + + string boundary = "------------ABCDEF-Boundary"; + string body = "\r\n--" + boundary + "\r\n" + + "Content-Id: <" + rootCid + ">\r\n" + + "Content-Type: " + rootType + "\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + rootContent + + "\r\n--" + boundary + "\r\n" + + // Voluntarily make a case-sensitivity error to test the SharePoint case + "Content-ID: <" + part2Cid + ">\r\n" + + "Content-Type: " + part2Type + "\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + part2Content + + "\r\n--" + boundary + "--\r\n"; + + // Added a space before one of the items as it may happen + string contentType = "multipart/related; start=\"" + rootCid + "\";type=\"" + rootType + "\";" + + "boundary=\"" + boundary + "\";start-info=\"" + startInfo + "\""; + + RelatedMultipart multipart( body, contentType ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong start Content id", rootCid, multipart.getStartId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong start info", startInfo, multipart.getStartInfo( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong boundary", boundary, multipart.getBoundary( ) ); + + vector< string > cids = multipart.getIds( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of parts parsed", size_t( 2 ), cids.size( ) ); + + RelatedPartPtr actualRoot = multipart.getPart( rootCid ); + CPPUNIT_ASSERT_MESSAGE( "No part corresponding to root cid", actualRoot.get( ) != NULL ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong root part content type", rootType, actualRoot->getContentType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong root part content", rootContent, actualRoot->getContent( ) ); + + RelatedPartPtr actualPart2 = multipart.getPart( part2Cid ); + CPPUNIT_ASSERT_MESSAGE( "No part corresponding to part2 cid", actualPart2.get( ) != NULL ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong part2 part content type", part2Type, actualPart2->getContentType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong part2 part content", part2Content, actualPart2->getContent( ) ); +} + +void SoapTest::getStreamFromNodeXopTest( ) +{ + // Create the test multipart + string dataCid = "http://data-cid"; + string dataCidEncoded = "http%3A%2F%2Fdata-cid"; + string dataContent = "Some transfered content"; + + string boundary = "------------ABCDEF-Boundary"; + string body = "\r\n--" + boundary + "\r\n" + + "Content-Id: <root-cid>\r\n" + + "Content-Type: text/plain\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + "Who cares? we assume, this has been properly extracted in this test" + + "\r\n--" + boundary + "\r\n" + + "Content-Id: " + dataCid + "\r\n" + + "Content-Type: text/plain\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + dataContent + + "\r\n--" + boundary + "--\r\n"; + + string contentType = string( "multipart/related;start=\"root-cid\";type=\"text/plain\";" ) + + "boundary=\"" + boundary + "\";start-info=\"info\""; + + RelatedMultipart multipart( body, contentType ); + + // Create test node + stringstream buf; + buf << "<stream>" + << " <xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:" << dataCidEncoded << "\"/>" + << "</stream>"; + test::XmlNodeRef node = test::getXmlNode( buf.str( ) ); + + // Run the tested method + boost::shared_ptr< istream > stream = getStreamFromNode( node, multipart ); + + // Checks + stringstream out; + out << stream->rdbuf( ); + CPPUNIT_ASSERT_EQUAL( dataContent, out.str( ) ); +} + +void SoapTest::getStreamFromNodeBase64Test( ) +{ + // Create the test multipart + string boundary = "------------ABCDEF-Boundary"; + string body = "\r\n--" + boundary + "\r\n" + + "Content-Id: <root-cid>\r\n" + + "Content-Type: text/plain\r\n" + + "Content-Transfer-Encoding: binary\r\n" + + "\r\n" + + "Who cares? we assume, this has been properly extracted in this test" + + "\r\n--" + boundary + "--\r\n"; + + string contentType = string( "multipart/related;start=\"root-cid\";type=\"text/plain\";" ) + + "boundary=\"" + boundary + "\";start-info=\"info\""; + + RelatedMultipart multipart( body, contentType ); + + // Create test node + string dataContent = "U29tZSB0cmFuc2ZlcmVkIGNvbnRlbnQ="; + string expectedContent = "Some transfered content"; + + stringstream buf; + buf << "<stream>" << dataContent << "</stream>"; + test::XmlNodeRef node = test::getXmlNode( buf.str( ) ); + + // Run the tested method + boost::shared_ptr< istream > stream = getStreamFromNode( node, multipart ); + + // Checks + stringstream out; + out << stream->rdbuf( ); + CPPUNIT_ASSERT_EQUAL( expectedContent, out.str( ) ); +} + +void SoapTest::writeCmismStreamTest( ) +{ + // Initialize the writer + xmlBufferPtr buf = xmlBufferCreate( ); + xmlTextWriterPtr writer = xmlNewTextWriterMemory( buf, 0 ); + xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); + + // Test writeCmismStream + RelatedMultipart multipart; + string contentType( "text/plain" ); + string content( "Expected content" ); + string filename( "name.txt" ); + boost::shared_ptr< ostream > os( new stringstream( content ) ); + writeCmismStream( writer, multipart, os, contentType, filename ); + + // Close the writer and check the results + xmlTextWriterEndDocument( writer ); + string str( ( const char * )xmlBufferContent( buf ) ); + + vector< string > ids = multipart.getIds( ); + CPPUNIT_ASSERT_EQUAL( size_t( 1 ), ids.size( ) ); + string partId = ids.front( ); + + RelatedPartPtr part = multipart.getPart( partId ); + CPPUNIT_ASSERT_MESSAGE( "Missing stream related part", part.get( ) != NULL ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content not properly attached", content, part->getContent( ) ); + + stringstream expectedXml; + expectedXml << "<?xml version=\"1.0\"?>\n" + << "<cmism:length>" << content.size( ) << "</cmism:length>" + << "<cmism:mimeType>" << contentType << "</cmism:mimeType>" + << "<cmism:filename>" << filename << "</cmism:filename>" + << "<cmism:stream>" + << "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:" << partId << "\"/>" + << "</cmism:stream>\n"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Envelope part isn't correct", expectedXml.str( ), str ); + + // Free it all + xmlFreeTextWriter( writer ); + xmlBufferFree( buf ); +} diff --git a/qa/libcmis/test-ws.cxx b/qa/libcmis/test-ws.cxx new file mode 100644 index 0000000..6857e63 --- /dev/null +++ b/qa/libcmis/test-ws.cxx @@ -0,0 +1,1505 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <memory> + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#define protected public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <ws-session.hxx> +#include <ws-object-type.hxx> + +#include <mockup-config.h> +#include <test-helpers.hxx> +#include <test-mockup-helpers.hxx> + +#define SERVER_URL string( "http://mockup/ws" ) +#define SERVER_REPOSITORY string( "mock" ) +#define SERVER_USERNAME "tester" +#define SERVER_PASSWORD "somepass" + +using namespace std; +using libcmis::PropertyPtrMap; + +namespace +{ + string lcl_getStreamAsString( boost::shared_ptr< istream > is ) + { + is->seekg( 0, ios::end ); + long size = is->tellg( ); + is->seekg( 0, ios::beg ); + + char* buf = new char[ size ]; + is->read( buf, size ); + string content( buf, size ); + delete[ ] buf; + + return content; + } + + string lcl_getCmisRequestXml( string url, const char* bodyMatch = NULL ) + { + const struct HttpRequest* request = curl_mockup_getRequest( url.c_str(), "", "POST", bodyMatch ); + char* contentType = curl_mockup_HttpRequest_getHeader( request, "Content-Type" ); + RelatedMultipart multipart( request->body, string( contentType ) ); + RelatedPartPtr part = multipart.getPart( multipart.getStartId() ); + string xml = part->getContent( ); + curl_mockup_HttpRequest_free( request ); + free( contentType ); + + string requestStr = test::getXmlNodeAsString( xml, "/soap-env:Envelope/soap-env:Body/child::*" ); + + // Obfuscate the xop:Include ids + string xopSearch = "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" href=\"cid:"; + size_t pos = requestStr.find( xopSearch ); + if ( pos != string::npos ) + { + pos = pos + xopSearch.size(); + size_t endPos = requestStr.find( "\"", pos ); + requestStr = requestStr.replace( pos, + endPos - pos, + "obfuscated" ); + } + return requestStr; + } + + string lcl_getExpectedNs( ) + { + string ns = " xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\"" + " xmlns:cmism=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\""; + return ns; + } +} + +typedef std::unique_ptr<WSSession> WSSessionPtr; + +class WSTest : public CppUnit::TestFixture +{ + public: + + void getRepositoriesTest( ); + void getRepositoryInfosTest( ); + void getRepositoryInfosBadTest( ); + + void getTypeTest( ); + void getTypeRefreshTest( ); + void objectTypeCopyTest( ); + void getUnexistantTypeTest( ); + void getTypeParentsTest( ); + void getTypeChildrenTest( ); + + void getObjectTest( ); + void getDocumentTest( ); + void getFolderTest( ); + void getByPathValidTest( ); + void getByPathInvalidTest( ); + void getDocumentParentsTest( ); + void getChildrenTest( ); + void getContentStreamTest( ); + void setContentStreamTest( ); + void getRenditionsTest( ); + void updatePropertiesTest( ); + void updatePropertiesEmptyTest( ); + void createFolderTest( ); + void createFolderBadTypeTest( ); + void createDocumentTest( ); + void deleteDocumentTest( ); + void deleteFolderTreeTest( ); + void moveTest( ); + void addSecondaryTypeTest( ); + + void checkOutTest( ); + void cancelCheckOutTest( ); + void checkInTest( ); + void getAllVersionsTest( ); + + void navigationServiceCopyTest(); + void repositoryServiceCopyTest(); + void objectServiceCopyTest(); + void versioningServiceCopyTest(); + + CPPUNIT_TEST_SUITE( WSTest ); + CPPUNIT_TEST( getRepositoriesTest ); + CPPUNIT_TEST( getRepositoryInfosTest ); + CPPUNIT_TEST( getRepositoryInfosBadTest ); + CPPUNIT_TEST( getTypeTest ); + CPPUNIT_TEST( getTypeRefreshTest ); + CPPUNIT_TEST( objectTypeCopyTest ); + CPPUNIT_TEST( getUnexistantTypeTest ); + CPPUNIT_TEST( getTypeParentsTest ); + CPPUNIT_TEST( getTypeChildrenTest ); + CPPUNIT_TEST( getObjectTest ); + CPPUNIT_TEST( getDocumentTest ); + CPPUNIT_TEST( getFolderTest ); + CPPUNIT_TEST( getByPathValidTest ); + CPPUNIT_TEST( getByPathInvalidTest ); + CPPUNIT_TEST( getDocumentParentsTest ); + CPPUNIT_TEST( getChildrenTest ); + CPPUNIT_TEST( getContentStreamTest ); + CPPUNIT_TEST( setContentStreamTest ); + CPPUNIT_TEST( getRenditionsTest ); + CPPUNIT_TEST( updatePropertiesTest ); + CPPUNIT_TEST( updatePropertiesEmptyTest ); + CPPUNIT_TEST( createFolderTest ); + CPPUNIT_TEST( createFolderBadTypeTest ); + CPPUNIT_TEST( createDocumentTest ); + CPPUNIT_TEST( deleteDocumentTest ); + CPPUNIT_TEST( deleteFolderTreeTest ); + CPPUNIT_TEST( moveTest ); + CPPUNIT_TEST( addSecondaryTypeTest ); + CPPUNIT_TEST( checkOutTest ); + CPPUNIT_TEST( cancelCheckOutTest ); + CPPUNIT_TEST( checkInTest ); + CPPUNIT_TEST( getAllVersionsTest ); + CPPUNIT_TEST( navigationServiceCopyTest ); + CPPUNIT_TEST( repositoryServiceCopyTest ); + CPPUNIT_TEST( objectServiceCopyTest ); + CPPUNIT_TEST( versioningServiceCopyTest ); + CPPUNIT_TEST_SUITE_END( ); + + libcmis::RepositoryPtr getTestRepository( ); + WSSessionPtr getTestSession( string username, string password, bool noRepos = false ); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( WSTest ); + +void WSTest::getRepositoriesTest() +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/repositories.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + map< string, string > actual = session->getRepositoryService().getRepositories( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of repositories", size_t( 1 ), actual.size( ) ); + + // Test the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService" ); + string expectedRequest = "<cmism:getRepositories" + lcl_getExpectedNs() + "/>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getRepositoryInfosTest() +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/repository-infos.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + string validId = "mock"; + libcmis::RepositoryPtr actual = session->getRepositoryService().getRepositoryInfo( validId ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Root folder is wrong", string( "root-folder" ), actual->getRootId( ) ); + + // Test the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService" ); + string expectedRequest = "<cmism:getRepositoryInfo" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>" + validId + "</cmism:repositoryId>" + "</cmism:getRepositoryInfo>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getRepositoryInfosBadTest() +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/repository-infos-bad.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + string badId = "bad"; + try + { + session->getRepositoryService().getRepositoryInfo( badId ); + } + catch( const libcmis::Exception& e ) + { + // Test the caught exception + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong exception type", string( "invalidArgument" ), e.getType( ) ); + + // Test the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService" ); + string expectedRequest = "<cmism:getRepositoryInfo" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>" + badId + "</cmism:repositoryId>" + "</cmism:getRepositoryInfo>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + } + +} + +void WSTest::getTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + string id( "cmis:folder" ); + libcmis::ObjectTypePtr actual = session->getType( id ); + + // Check the returned type + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", id, actual->getId( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService" ); + string expectedRequest = "<cmism:getTypeDefinition" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:typeId>" + id + "</cmism:typeId>" + "</cmism:getTypeDefinition>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getTypeRefreshTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/type-docLevel2.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + string id( "DocumentLevel2" ); + libcmis::ObjectTypePtr actual = session->getType( id ); + + // Check the returned type + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", id, actual->getId( ) ); + + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/type-docLevel1.http" ); + + + // Do the refresh + actual->refresh(); + + // Check the refreshed object + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id", string( "DocumentLevel1" ), + actual->getId( ) ); +} + +void WSTest::objectTypeCopyTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + string id( "cmis:folder" ); + libcmis::ObjectTypePtr expected = session->getType( id ); + WSObjectType* type = dynamic_cast< WSObjectType* >( expected.get( ) ); + + { + WSObjectType copy( *type ); + + CPPUNIT_ASSERT_EQUAL( type->getId( ), copy.getId( ) ); + CPPUNIT_ASSERT_EQUAL( type->m_session, copy.m_session ); + } + + { + WSObjectType copy; + copy = *type; + + CPPUNIT_ASSERT_EQUAL( type->getId( ), copy.getId( ) ); + CPPUNIT_ASSERT_EQUAL( type->m_session, copy.m_session ); + } +} + +void WSTest::getUnexistantTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-bad.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + string id( "bad_type" ); + try + { + session->getType( id ); + } + catch ( const libcmis::Exception& e ) + { + // Check the caught exception + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService" ); + string expectedRequest = "<cmism:getTypeDefinition" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:typeId>" + id + "</cmism:typeId>" + "</cmism:getTypeDefinition>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + } +} + +void WSTest::getTypeParentsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/type-docLevel2.http", + "<cmism:typeId>DocumentLevel2</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/type-docLevel1.http", + "<cmism:typeId>DocumentLevel1</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/type-document.http", + "<cmism:typeId>cmis:document</cmism:typeId>" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "DocumentLevel2"; + libcmis::ObjectTypePtr actual = session->getType( id ); + + // Check the resulting type + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Parent type Id", string( "DocumentLevel1" ), + actual->getParentTypeId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Base type Id", string( "cmis:document" ), + actual->getBaseTypeId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Parent type", string( "DocumentLevel1" ), + actual->getParentType()->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Base type", string( "cmis:document" ), + actual->getBaseType()->getId( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService" ); + string expectedRequest = "<cmism:getTypeDefinition" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:typeId>" + id + "</cmism:typeId>" + "</cmism:getTypeDefinition>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getTypeChildrenTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/typechildren-document.http", + "<cmism:getTypeChildren "); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", + DATA_DIR "/ws/type-document.http", + "<cmism:typeId>cmis:document</cmism:typeId>" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "cmis:document"; + libcmis::ObjectTypePtr actual = session->getType( id ); + vector< libcmis::ObjectTypePtr > children = actual->getChildren(); + + // Check the actual children returned + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 1 ), children.size( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/RepositoryService", + "<cmism:getTypeChildren " ); + string expectedRequest = "<cmism:getTypeChildren" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:typeId>" + id + "</cmism:typeId>" + "<cmism:includePropertyDefinitions>true</cmism:includePropertyDefinitions>" + "</cmism:getTypeChildren>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getObjectTest( ) +{ + // Setup the mockup + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/valid-object.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // Run the tested method + string expectedId( "valid-object" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + // Check the returned object + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched object", + expectedId, actual->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong type for fetched object", + string( "cmis:folder" ), actual->getType() ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService" ); + string expectedRequest = "<cmism:getObject" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + expectedId + "</cmism:objectId>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "<cmism:renditionFilter>*</cmism:renditionFilter>" + "</cmism:getObject>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getDocumentTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string expectedId( "test-document" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + // Do we have a document? + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( actual ); + CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", + NULL != document ); + + // Check the document properties + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", expectedId, document->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "Test Document" ), document->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "text/plain" ), document->getContentType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !document->getChangeToken( ).empty( ) ); + + CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService" ); + string expectedRequest = "<cmism:getObject" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + expectedId + "</cmism:objectId>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "<cmism:renditionFilter>*</cmism:renditionFilter>" + "</cmism:getObject>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getFolderTest( ) +{ + // Setup the mockup + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/valid-object.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // Run the method under test + string expectedId( "valid-object" ); + libcmis::FolderPtr actual = session->getFolder( expectedId ); + + // Check the returned folder + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder ID", expectedId, actual->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder name", string( "Valid Object" ), actual->getName( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong folder path", string( "/Valid Object" ), actual->getPath( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:folder" ), actual->getBaseType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Missing folder parent ID", + string( "root-folder" ), actual->getParentId() ); + CPPUNIT_ASSERT_MESSAGE( "Not a root folder", !actual->isRootFolder() ); + + CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !actual->getCreatedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !actual->getCreationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !actual->getLastModifiedBy( ).empty( ) ); + CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !actual->getLastModificationDate( ).is_not_a_date_time() ); + CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !actual->getChangeToken( ).empty( ) ); + + // No need to check the request: we do the same one in another test +} + +void WSTest::getByPathValidTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/valid-object.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string path = "/Valid Object"; + libcmis::ObjectPtr actual = session->getObjectByPath( path ); + + // Check the returned object + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong Id for fetched object", string( "valid-object" ), actual->getId( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService" ); + string expectedRequest = "<cmism:getObjectByPath" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:path>" + path + "</cmism:path>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "<cmism:renditionFilter>*</cmism:renditionFilter>" + "</cmism:getObjectByPath>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getByPathInvalidTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/getbypath-bad.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string path = "/some/invalid/path"; + try + { + session->getObjectByPath( path ); + CPPUNIT_FAIL( "Exception should be thrown: invalid Path" ); + } + catch ( const libcmis::Exception& e ) + { + // Check the caught exception + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "objectNotFound" ), e.getType() ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService" ); + string expectedRequest = "<cmism:getObjectByPath" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:path>" + path + "</cmism:path>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "<cmism:renditionFilter>*</cmism:renditionFilter>" + "</cmism:getObjectByPath>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + } + +} + +void WSTest::getDocumentParentsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/NavigationService", DATA_DIR "/ws/test-document-parents.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "test-document"; + vector< libcmis::FolderPtr > actual = session->getNavigationService(). + getObjectParents( session->m_repositoryId, + id ); + + // Check the actual parents + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad number of parents", size_t( 2 ), actual.size() ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/NavigationService" ); + string expectedRequest = "<cmism:getObjectParents" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "<cmism:renditionFilter>*</cmism:renditionFilter>" + "</cmism:getObjectParents>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getChildrenTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http", "<cmism:typeId>cmis:folder</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http", "<cmism:typeId>DocumentLevel2</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/NavigationService", DATA_DIR "/ws/root-children.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + + string id = "root-folder"; + vector< libcmis::ObjectPtr > children = session->getNavigationService(). + getChildren( session->m_repositoryId, + id ); + + // Check the returned children + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of children", size_t( 5 ), children.size() ); + + int folderCount = 0; + int documentCount = 0; + for ( vector< libcmis::ObjectPtr >::iterator it = children.begin( ); + it != children.end( ); ++it ) + { + if ( NULL != boost::dynamic_pointer_cast< libcmis::Folder >( *it ) ) + ++folderCount; + else if ( NULL != boost::dynamic_pointer_cast< libcmis::Document >( *it ) ) + ++documentCount; + } + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of folder children", 2, folderCount ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of document children", 3, documentCount ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/NavigationService" ); + string expectedRequest = "<cmism:getChildren" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:folderId>" + id + "</cmism:folderId>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "<cmism:renditionFilter>*</cmism:renditionFilter>" + "</cmism:getChildren>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getContentStreamTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/get-content-stream.http", "<cmism:getContentStream " ); + + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + boost::shared_ptr< istream > is = document->getContentStream( ); + + // Check the fetched content + string actualContent = lcl_getStreamAsString( is ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Content stream doesn't match", + string( "Some content stream" ), actualContent ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:getContentStream " ); + string expectedRequest = "<cmism:getContentStream" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "</cmism:getContentStream>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::setContentStreamTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/set-content-stream.http", "<cmism:setContentStream " ); + curl_mockup_addResponse( "http://mockup/mock/content/data.txt", "id=test-document", "PUT", "Updated", 0, false ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + try + { + string oldChangeToken = object->getChangeToken( ); + string expectedContent( "Some content stream to set" ); + boost::shared_ptr< ostream > os ( new stringstream ( expectedContent ) ); + string filename( "name.txt" ); + string contentType( "text/plain" ); + document->setContentStream( os, contentType, filename, true ); + + CPPUNIT_ASSERT_MESSAGE( "Object not refreshed during setContentStream", object->getRefreshTimestamp( ) > 0 ); + // We do not check the change token as we are lazy + // That would require to write another answer file for the refresh + + // Check the sent request + ostringstream converter; + converter << expectedContent.size( ); + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:setContentStream " ); + string expectedRequest = "<cmism:setContentStream" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:overwriteFlag>true</cmism:overwriteFlag>" + "<cmism:changeToken>" + oldChangeToken + "</cmism:changeToken>" + "<cmism:contentStream>" + "<cmism:length>" + converter.str() + "</cmism:length>" + "<cmism:mimeType>" + contentType + "</cmism:mimeType>" + "<cmism:filename>" + filename + "</cmism:filename>" + "<cmism:stream>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" " + "href=\"cid:obfuscated\"/>" + "</cmism:stream>" + "</cmism:contentStream>" + "</cmism:setContentStream>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + } + catch ( const libcmis::Exception& e ) + { + string msg = "Unexpected exception: "; + msg += e.what(); + CPPUNIT_FAIL( msg.c_str() ); + } +} + +void WSTest::getRenditionsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/get-renditions.http", "<cmism:getRenditions " ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string expectedId( "test-document" ); + libcmis::ObjectPtr actual = session->getObject( expectedId ); + + std::vector< libcmis::RenditionPtr > renditions = actual->getRenditions( ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad renditions count", size_t( 2 ), renditions.size( ) ); + + libcmis::RenditionPtr rendition = renditions[1]; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition mime type", string( "application/pdf" ), rendition->getMimeType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition stream id", string( "test-document-rendition2" ), rendition->getStreamId() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition length - default case", long( -1 ), rendition->getLength( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition Title", string( "Doc as PDF" ), rendition->getTitle( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition kind", string( "pdf" ), rendition->getKind( ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad rendition length - filled case", long( 40385 ), renditions[0]->getLength( ) ); +} + +void WSTest::updatePropertiesTest( ) +{ + curl_mockup_reset( ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/update-properties.http", "<cmism:updateProperties " ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // Values for the test + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + string propertyName( "cmis:name" ); + string expectedValue( "New name" ); + + // Fill the map of properties to change + PropertyPtrMap newProperties; + + libcmis::ObjectTypePtr objectType = object->getTypeDescription( ); + map< string, libcmis::PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( propertyName ); + vector< string > values; + values.push_back( expectedValue ); + libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); + newProperties[ propertyName ] = property; + + // Change the object response to provide the updated values + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document-updated.http", "<cmism:getObject " ); + + // Update the properties (method to test) + libcmis::ObjectPtr updated = object->updateProperties( newProperties ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:updateProperties " ); + string expectedRequest = "<cmism:updateProperties" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:changeToken>some-change-token</cmism:changeToken>" + "<cmism:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>New name</cmis:value>" + "</cmis:propertyString>" + "</cmism:properties>" + "</cmism:updateProperties>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + + // Check that the properties are updated after the call + PropertyPtrMap::iterator propIt = updated->getProperties( ).find( propertyName ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong value after refresh", expectedValue, propIt->second->getStrings().front( ) ); +} + +void WSTest::updatePropertiesEmptyTest( ) +{ + curl_mockup_reset( ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // Values for the test + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + + // Just leave the map empty and update + PropertyPtrMap emptyProperties; + libcmis::ObjectPtr updated = object->updateProperties( emptyProperties ); + + // Check that no HTTP request was sent + int count = curl_mockup_getRequestsCount( "http://mockup/ws/services/ObjectService", + "", "POST", "<cmism:updateProperties" ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "No HTTP request should have been sent", 0, count ); + + // Check that the object we got is the same than previous one + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong change token", object->getChangeToken(), updated->getChangeToken() ); +} + +void WSTest::createFolderTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/root-folder.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/create-folder.http", "<cmism:createFolder " ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "cmis:folder" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + string expectedName( "create folder" ); + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( expectedName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "cmis:folder" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Set the mockup to send the updated folder now that we had the parent + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/created-folder.http", "<cmism:getObject " ); + + // Actually send the folder creation request + libcmis::FolderPtr created = parent->createFolder( props ); + + // Check that something came back + CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", + !created->getChangeToken( ).empty() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong name", expectedName, created->getName( ) ); + + // Check that the proper request has been sent + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:createFolder " ); + string expectedRequest = "<cmism:createFolder" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>create folder</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\" localName=\"cmis:objectTypeId\"" + " displayName=\"Type-Id\" queryName=\"cmis:objectTypeId\">" + "<cmis:value>cmis:folder</cmis:value>" + "</cmis:propertyId>" + "</cmism:properties>" + "<cmism:folderId>root-folder</cmism:folderId>" + "</cmism:createFolder>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::createFolderBadTypeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/root-folder.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/create-folder-bad-type.http", "<cmism:createFolder " ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "cmis:folder" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + string expectedName( "create folder" ); + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( expectedName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "cmis:document" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Actually send the folder creation request + try + { + libcmis::FolderPtr created = parent->createFolder( props ); + CPPUNIT_FAIL( "Should not succeed to return a folder" ); + } + catch ( libcmis::Exception& e ) + { + // Check the caught exception + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong error type", string( "constraint" ), e.getType() ); + + // Check that the proper request has been sent + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:createFolder " ); + string expectedRequest = "<cmism:createFolder" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>create folder</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\" localName=\"cmis:objectTypeId\"" + " displayName=\"Type-Id\" queryName=\"cmis:objectTypeId\">" + "<cmis:value>cmis:document</cmis:value>" + "</cmis:propertyId>" + "</cmism:properties>" + "<cmism:folderId>root-folder</cmism:folderId>" + "</cmism:createFolder>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + } +} + +void WSTest::createDocumentTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/create-document.http", "<cmism:createDocument " ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/root-folder.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + libcmis::FolderPtr parent = session->getRootFolder( ); + + // Make the mockup know about cmis:document now + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-document.http" ); + + // Prepare the properties for the new object, object type is cmis:folder + PropertyPtrMap props; + libcmis::ObjectTypePtr type = session->getType( "cmis:document" ); + map< string, libcmis::PropertyTypePtr > propTypes = type->getPropertiesTypes( ); + + // Set the object name + string expectedName( "create document" ); + + map< string, libcmis::PropertyTypePtr >::iterator it = propTypes.find( string( "cmis:name" ) ); + vector< string > nameValues; + nameValues.push_back( expectedName ); + libcmis::PropertyPtr nameProperty( new libcmis::Property( it->second, nameValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:name" ), nameProperty ) ); + + // set the object type + it = propTypes.find( string( "cmis:objectTypeId" ) ); + vector< string > typeValues; + typeValues.push_back( "cmis:document" ); + libcmis::PropertyPtr typeProperty( new libcmis::Property( it->second, typeValues ) ); + props.insert( pair< string, libcmis::PropertyPtr >( string( "cmis:objectTypeId" ), typeProperty ) ); + + // Make the mockup able to send the response to update the object + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/created-document.http", "<cmism:getObject " ); + + // Actually send the document creation request + string content = "Some content"; + boost::shared_ptr< ostream > os ( new stringstream( content ) ); + string contentType = "text/plain"; + string filename( "name.txt" ); + libcmis::DocumentPtr created = parent->createDocument( props, os, contentType, filename ); + + // Check that something came back + CPPUNIT_ASSERT_MESSAGE( "Change token shouldn't be empty: object should have been refreshed", + !created->getChangeToken( ).empty() ); + + // Check that the name is ok + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong name set", expectedName, created->getName( ) ); + + // Check that the sent request is the expected one + ostringstream converter; + converter << content.size( ); + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:createDocument " ); + string expectedRequest = "<cmism:createDocument" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:name\" localName=\"cmis:name\" " + "displayName=\"Name\" queryName=\"cmis:name\">" + "<cmis:value>create document</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\" localName=\"cmis:objectTypeId\"" + " displayName=\"Type-Id\" queryName=\"cmis:objectTypeId\">" + "<cmis:value>cmis:document</cmis:value>" + "</cmis:propertyId>" + "</cmism:properties>" + "<cmism:folderId>root-folder</cmism:folderId>" + "<cmism:contentStream>" + "<cmism:length>" + converter.str( ) + "</cmism:length>" + "<cmism:mimeType>" + contentType + "</cmism:mimeType>" + "<cmism:filename>" + filename + "</cmism:filename>" + "<cmism:stream>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" " + "href=\"cid:obfuscated\"/>" + "</cmism:stream>" + "</cmism:contentStream>" + "</cmism:createDocument>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::deleteDocumentTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/delete-object.http", "<cmism:deleteObject " ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); + + // Run the tested method. Here we delete the object with all its versions + document->remove( true ); + + // Check that the proper request has been sent + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:deleteObject " ); + string expectedRequest = "<cmism:deleteObject" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:allVersions>true</cmism:allVersions>" + "</cmism:deleteObject>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::deleteFolderTreeTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/valid-object.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/delete-tree.http", "<cmism:deleteTree " ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "valid-object"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::Folder* folder = dynamic_cast< libcmis::Folder* >( object.get() ); + + vector<string> failed = folder->removeTree( true, libcmis::UnfileObjects::Delete, false ); + + // Check that we had the failed ids + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong ids for non-deleted objects", + string( "bad-delete" ), failed[0] ); + + // Test the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:deleteTree " ); + string expectedRequest = "<cmism:deleteTree" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:folderId>valid-object</cmism:folderId>" + "<cmism:allVersions>true</cmism:allVersions>" + "<cmism:unfileObjects>delete</cmism:unfileObjects>" + "<cmism:continueOnFailure>false</cmism:continueOnFailure>" + "</cmism:deleteTree>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::moveTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-folder.http", "<cmism:typeId>cmis:folder</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http", "<cmism:typeId>DocumentLevel2</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/NavigationService", DATA_DIR "/ws/test-document-parents.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/move-object.http", "<cmism:moveObject " ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); + + string destFolderId = "valid-object"; + libcmis::FolderPtr src = document->getParents( ).front( ); + + // Tell the mockup about the destination folder + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/valid-object.http", "<cmism:getObject " ); + libcmis::FolderPtr dest = session->getFolder( destFolderId ); + + document->move( src, dest ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:moveObject " ); + string expectedRequest = "<cmism:moveObject" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:targetFolderId>" + destFolderId + "</cmism:targetFolderId>" + "<cmism:sourceFolderId>" + src->getId( ) + "</cmism:sourceFolderId>" + "</cmism:moveObject>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::addSecondaryTypeTest( ) +{ + curl_mockup_reset( ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/secondary-type.http", + "<cmism:typeId>secondary-type</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2-secondary.http", + "<cmism:typeId>DocumentLevel2</cmism:typeId>" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:getObject " ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/update-properties.http", "<cmism:updateProperties " ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // Values for the test + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + string secondaryType = "secondary-type"; + string propertyName = "secondary-prop"; + string expectedValue = "some-value"; + + // Fill the map of properties to change + PropertyPtrMap newProperties; + + libcmis::ObjectTypePtr objectType = session->getType( secondaryType ); + map< string, libcmis::PropertyTypePtr >::iterator it = objectType->getPropertiesTypes( ).find( propertyName ); + vector< string > values; + values.push_back( expectedValue ); + libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); + newProperties[ propertyName ] = property; + + // Change the object response to provide the updated values + test::addWsResponse( "http://mockup/ws/services/ObjectService", + DATA_DIR "/ws/test-document-add-secondary.http", + "<cmism:getObject " ); + + // add the secondary type (method to test) + libcmis::ObjectPtr updated = object->addSecondaryType( secondaryType, newProperties ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/ObjectService", "<cmism:updateProperties " ); + string expectedRequest = "<cmism:updateProperties" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:changeToken>some-change-token</cmism:changeToken>" + "<cmism:properties>" + "<cmis:propertyString propertyDefinitionId=\"cmis:secondaryObjectTypeIds\"" + " localName=\"cmis:secondaryObjectTypeIds\"" + " displayName=\"cmis:secondaryObjectTypeIds\"" + " queryName=\"cmis:secondaryObjectTypeIds\">" + "<cmis:value>" + secondaryType + "</cmis:value>" + "</cmis:propertyString>" + "<cmis:propertyString propertyDefinitionId=\"" + propertyName + "\"" + " localName=\"" + propertyName + "\"" + " displayName=\"" + propertyName + "\"" + " queryName=\"" + propertyName + "\">" + "<cmis:value>" + expectedValue + "</cmis:value>" + "</cmis:propertyString>" + "</cmism:properties>" + "</cmism:updateProperties>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); + + // Check that the properties are updated after the call + PropertyPtrMap::iterator propIt = updated->getProperties( ).find( propertyName ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong value after refresh", expectedValue, propIt->second->getStrings().front( ) ); +} + +void WSTest::checkOutTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http", "<cmism:objectId>test-document</cmism:objectId>" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/working-copy.http", "<cmism:objectId>working-copy</cmism:objectId>" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/VersioningService", DATA_DIR "/ws/checkout.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::Document* document = dynamic_cast< libcmis::Document* >( object.get() ); + + libcmis::DocumentPtr pwc = document->checkOut( ); + + // Check that we have a PWC + CPPUNIT_ASSERT_MESSAGE( "Missing returned Private Working Copy", pwc.get( ) != NULL ); + + PropertyPtrMap::iterator it = pwc->getProperties( ).find( string( "cmis:isVersionSeriesCheckedOut" ) ); + vector< bool > values = it->second->getBools( ); + CPPUNIT_ASSERT_MESSAGE( "cmis:isVersionSeriesCheckedOut isn't true", values.front( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/VersioningService" ); + string expectedRequest = "<cmism:checkOut" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "</cmism:checkOut>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::cancelCheckOutTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/working-copy.http" ); + test::addWsResponse( "http://mockup/ws/services/VersioningService", DATA_DIR "/ws/cancel-checkout.http" ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // First get a checked out document + string id = "working-copy"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + pwc->cancelCheckout( ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/VersioningService" ); + string expectedRequest = "<cmism:cancelCheckOut" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "</cmism:cancelCheckOut>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::checkInTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/working-copy.http", "<cmism:objectId>working-copy</cmism:objectId>" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/checked-in.http", "<cmism:objectId>test-document</cmism:objectId>" ); + test::addWsResponse( "http://mockup/ws/services/VersioningService", DATA_DIR "/ws/checkin.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // First get a checked out document + string id = "working-copy"; + libcmis::ObjectPtr object = session->getObject( id ); + libcmis::DocumentPtr pwc = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + // Do the checkin + bool isMajor = true; + string comment( "Some check-in comment" ); + PropertyPtrMap properties; + string newContent = "Some New content to check in"; + boost::shared_ptr< ostream > stream ( new stringstream( newContent ) ); + string contentType = "text/plain"; + string filename = "filename.txt"; + libcmis::DocumentPtr updated = pwc->checkIn( isMajor, comment, properties, + stream, contentType, filename ); + + // Check that we had the new version + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong filename: probably not the new version", + filename, updated->getContentFilename() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong commit comment: not the new version", + comment, updated->getStringProperty( "cmis:checkinComment" ) ); + + // Check the sent request + ostringstream converter; + converter << newContent.size( ); + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/VersioningService" ); + string expectedRequest = "<cmism:checkIn" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + id + "</cmism:objectId>" + "<cmism:major>true</cmism:major>" + "<cmism:properties/>" + "<cmism:contentStream>" + "<cmism:length>" + converter.str() + "</cmism:length>" + "<cmism:mimeType>" + contentType + "</cmism:mimeType>" + "<cmism:filename>" + filename + "</cmism:filename>" + "<cmism:stream>" + "<xop:Include xmlns:xop=\"http://www.w3.org/2004/08/xop/include\" " + "href=\"cid:obfuscated\"/>" + "</cmism:stream>" + "</cmism:contentStream>" + "<cmism:checkinComment>" + comment + "</cmism:checkinComment>" + "</cmism:checkIn>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::getAllVersionsTest( ) +{ + curl_mockup_reset( ); + curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); + test::addWsResponse( "http://mockup/ws/services/RepositoryService", DATA_DIR "/ws/type-docLevel2.http" ); + test::addWsResponse( "http://mockup/ws/services/ObjectService", DATA_DIR "/ws/test-document.http" ); + test::addWsResponse( "http://mockup/ws/services/VersioningService", DATA_DIR "/ws/get-versions.http" ); + + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + + // First get a document + string id = "test-document"; + libcmis::ObjectPtr object = session->getObject( id ); + string seriesId = object->getStringProperty( "cmis:versionSeriesId" ); + libcmis::DocumentPtr doc = boost::dynamic_pointer_cast< libcmis::Document >( object ); + + // Get all the versions (method to check) + vector< libcmis::DocumentPtr > versions = doc->getAllVersions( ); + + // Checks + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of versions", size_t( 2 ), versions.size( ) ); + + // Check the sent request + string xmlRequest = lcl_getCmisRequestXml( "http://mockup/ws/services/VersioningService" ); + string expectedRequest = "<cmism:getAllVersions" + lcl_getExpectedNs() + ">" + "<cmism:repositoryId>mock</cmism:repositoryId>" + "<cmism:objectId>" + seriesId + "</cmism:objectId>" + "<cmism:includeAllowableActions>true</cmism:includeAllowableActions>" + "</cmism:getAllVersions>"; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong request sent", expectedRequest, xmlRequest ); +} + +void WSTest::navigationServiceCopyTest() +{ + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + NavigationService service( session.get() ); + + { + NavigationService copy( service ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } + + { + NavigationService copy; + copy = service; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } +} + +void WSTest::repositoryServiceCopyTest() +{ + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + RepositoryService service( session.get() ); + + { + RepositoryService copy( service ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } + + { + RepositoryService copy; + copy = service; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } +} + +void WSTest::objectServiceCopyTest() +{ + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + ObjectService service( session.get() ); + + { + ObjectService copy( service ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } + + { + ObjectService copy; + copy = service; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } +} + +void WSTest::versioningServiceCopyTest() +{ + WSSessionPtr session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD, true ); + VersioningService service( session.get() ); + + { + VersioningService copy( service ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } + + { + VersioningService copy; + copy = service; + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Session not copied", service.m_session, copy.m_session ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "URL not copied", service.m_url, copy.m_url ); + } +} + +WSSessionPtr WSTest::getTestSession( string username, string password, bool noRepos ) +{ + WSSessionPtr session( new WSSession( ) ); + session->m_username = username; + session->m_password = password; + + string buf; + test::loadFromFile( DATA_DIR "/ws/CMISWS-Service.wsdl", buf ); + session->parseWsdl( buf ); + session->initializeResponseFactory( ); + + // Manually define the repositories to avoid the HTTP query + if ( noRepos ) + { + libcmis::RepositoryPtr repo = getTestRepository( ); + session->m_repositories.push_back( repo ); + session->m_repositoryId = repo->getId( ); + } + + return session; +} + +libcmis::RepositoryPtr WSTest::getTestRepository() +{ + libcmis::RepositoryPtr repo( new libcmis::Repository( ) ); + repo->m_id = "mock"; + repo->m_name = "Mockup"; + repo->m_description = "Repository sent by mockup server"; + repo->m_vendorName = "libcmis"; + repo->m_productName = "Libcmis mockup"; + repo->m_productVersion = "some-version"; + repo->m_cmisVersionSupported = "1.1"; + repo->m_rootId = "root-folder"; + + map< libcmis::Repository::Capability, string > capabilities; + capabilities[libcmis::Repository::ACL] = "manage"; + capabilities[libcmis::Repository::AllVersionsSearchable] = "false"; + capabilities[libcmis::Repository::Changes] = "none"; + capabilities[libcmis::Repository::ContentStreamUpdatability] = "anytime"; + capabilities[libcmis::Repository::GetDescendants] = "true"; + capabilities[libcmis::Repository::GetFolderTree] = "true"; + capabilities[libcmis::Repository::Multifiling] = "true"; + capabilities[libcmis::Repository::PWCSearchable] = "false"; + capabilities[libcmis::Repository::PWCUpdatable] = "true"; + capabilities[libcmis::Repository::Query] = "bothcombined"; + capabilities[libcmis::Repository::Renditions] = "read"; + capabilities[libcmis::Repository::Unfiling] = "true"; + capabilities[libcmis::Repository::VersionSpecificFiling] = "false"; + capabilities[libcmis::Repository::Join] = "none"; + repo->m_capabilities = capabilities; + + return repo; +} diff --git a/qa/libcmis/test-xmlutils.cxx b/qa/libcmis/test-xmlutils.cxx new file mode 100644 index 0000000..e4d5339 --- /dev/null +++ b/qa/libcmis/test-xmlutils.cxx @@ -0,0 +1,626 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <ctime> +#include <sstream> + +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestFixture.h> +#include <cppunit/TestAssert.h> +#include <cppunit/ui/text/TestRunner.h> +#include <libxml/tree.h> + +#if defined __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define private public +#if defined __clang__ +#pragma clang diagnostic pop +#endif + +#include <libcmis/object-type.hxx> +#include <libcmis/property.hxx> +#include <libcmis/property-type.hxx> +#include <libcmis/xml-utils.hxx> + +#include "test-helpers.hxx" + +using namespace boost; +using namespace std; +using namespace test; + +class XmlTest : public CppUnit::TestFixture +{ + public: + + // Parser tests + void parseDateTimeTest( ); + void parseBoolTest( ); + void parseIntegerTest( ); + void parseDoubleTest( ); + + void parsePropertyStringTest( ); + void parsePropertyIntegerTest( ); + void parsePropertyDateTimeTest( ); + void parsePropertyBoolTest( ); + + void parseEmptyPropertyTest( ); + void parsePropertyNoTypeTest( ); + + void parseRenditionTest( ); + void parseRepositoryCapabilitiesTest( ); + + // Writer tests + void propertyStringAsXmlTest( ); + void propertyIntegerAsXmlTest( ); + + // Other tests + void sha1Test( ); + void propertyTypeUpdateTest( ); + void escapeTest( ); + void unescapeTest( ); + + CPPUNIT_TEST_SUITE( XmlTest ); + CPPUNIT_TEST( parseDateTimeTest ); + CPPUNIT_TEST( parseBoolTest ); + CPPUNIT_TEST( parseIntegerTest ); + CPPUNIT_TEST( parseDoubleTest ); + CPPUNIT_TEST( parsePropertyStringTest ); + CPPUNIT_TEST( parsePropertyIntegerTest ); + CPPUNIT_TEST( parsePropertyDateTimeTest ); + CPPUNIT_TEST( parsePropertyBoolTest ); + CPPUNIT_TEST( parseEmptyPropertyTest ); + CPPUNIT_TEST( parsePropertyNoTypeTest ); + CPPUNIT_TEST( parseRenditionTest ); + CPPUNIT_TEST( parseRepositoryCapabilitiesTest ); + CPPUNIT_TEST( propertyStringAsXmlTest ); + CPPUNIT_TEST( propertyIntegerAsXmlTest ); + CPPUNIT_TEST( sha1Test ); + CPPUNIT_TEST( propertyTypeUpdateTest ); + CPPUNIT_TEST( escapeTest ); + CPPUNIT_TEST( unescapeTest ); + CPPUNIT_TEST_SUITE_END( ); +}; + +/** Dummy ObjectType implementation used as a PropertyType factory. + */ +class ObjectTypeDummy : public libcmis::ObjectType +{ + public: + ObjectTypeDummy( ); + virtual ~ObjectTypeDummy() { }; +}; + +ObjectTypeDummy::ObjectTypeDummy( ) +{ + // String Property + { + libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); + prop->setId( string( "STR-ID" ) ); + prop->setLocalName( string( "LOCAL" ) ); + prop->setDisplayName( string( "DISPLAY" ) ); + prop->setQueryName( string( "QUERY" ) ); + prop->setTypeFromXml( "string" ); + + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); + } + + // Integer Property + { + libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); + prop->setId( string( "INT-ID" ) ); + prop->setLocalName( string( "LOCAL" ) ); + prop->setDisplayName( string( "DISPLAY" ) ); + prop->setQueryName( string( "QUERY" ) ); + prop->setTypeFromXml( "integer" ); + + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); + } + + // DateTime Property + { + libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); + prop->setId( string( "DATE-ID" ) ); + prop->setLocalName( string( "LOCAL" ) ); + prop->setDisplayName( string( "DISPLAY" ) ); + prop->setQueryName( string( "QUERY" ) ); + prop->setTypeFromXml( "datetime" ); + + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); + } + + // Boolean Property + { + libcmis::PropertyTypePtr prop ( new libcmis::PropertyType( ) ); + prop->setId( string( "BOOL-ID" ) ); + prop->setLocalName( string( "LOCAL" ) ); + prop->setDisplayName( string( "DISPLAY" ) ); + prop->setQueryName( string( "QUERY" ) ); + prop->setTypeFromXml( "boolean" ); + + m_propertiesTypes.insert( pair< string, libcmis::PropertyTypePtr >( prop->getId( ), prop ) ); + } +} + +void XmlTest::parseDateTimeTest( ) +{ + tm basis; + basis.tm_year = 2011 - 1900; + basis.tm_mon = 8; // Months are in 0..11 range + basis.tm_mday = 28; + basis.tm_hour = 12; + basis.tm_min = 44; + basis.tm_sec = 28; + + // Broken strings + { + posix_time::ptime expected( boost::date_time::not_a_date_time ); + + posix_time::ptime t = libcmis::parseDateTime( string() ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Broken time string case failed #1", + expected, t ); + + char toParse[50]; + strftime( toParse, sizeof( toParse ), "%FT", &basis ); + t = libcmis::parseDateTime( string( toParse ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Broken time string case failed #2", + expected, t ); + + strftime( toParse, sizeof( toParse ), "T%T", &basis ); + t = libcmis::parseDateTime( string( toParse ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Broken time string case failed #3", + expected, t ); + + strftime( toParse, sizeof( toParse ), "%T", &basis ); + t = libcmis::parseDateTime( string( toParse ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Broken time string case failed #4", + expected, t ); + } + + // No time zone test + { + char toParse[50]; + strftime( toParse, sizeof( toParse ), "%FT%T", &basis ); + posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); + + gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); + posix_time::time_duration expTime( basis.tm_hour, basis.tm_min, basis.tm_sec ); + posix_time::ptime expected( expDate, expTime ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "No time zone case failed", expected, t ); + } + + // Z time zone test + { + char toParse[50]; + strftime( toParse, sizeof( toParse ), "%FT%TZ", &basis ); + posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); + + gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); + posix_time::time_duration expTime( basis.tm_hour, basis.tm_min, basis.tm_sec ); + posix_time::ptime expected( expDate, expTime ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Z time zone case failed", expected, t ); + } + + // +XX:XX time zone test + { + char toParse[50]; + strftime( toParse, sizeof( toParse ), "%FT%T+02:00", &basis ); + posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); + + gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); + posix_time::time_duration expTime( basis.tm_hour + 2, basis.tm_min, basis.tm_sec ); + posix_time::ptime expected( expDate, expTime ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "+XX:XX time zone case failed", expected, t ); + } + + // -XX:XX time zone test + { + char toParse[50]; + strftime( toParse, sizeof( toParse ), "%FT%T-02:00", &basis ); + posix_time::ptime t = libcmis::parseDateTime( string( toParse ) ); + + gregorian::date expDate( basis.tm_year + 1900, basis.tm_mon + 1, basis.tm_mday ); + posix_time::time_duration expTime( basis.tm_hour - 2, basis.tm_min, basis.tm_sec ); + posix_time::ptime expected( expDate, expTime ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "+XX:XX time zone case failed", expected, t ); + } + + // Error test + { + posix_time::ptime t = libcmis::parseDateTime( string( "Nothing interesting 9990" ) ); + CPPUNIT_ASSERT_MESSAGE( "Error case failed", t.is_not_a_date_time( ) ); + } +} + +void XmlTest::parseBoolTest( ) +{ + // 'true' test + { + bool result = libcmis::parseBool( string( "true" ) ); + CPPUNIT_ASSERT_MESSAGE( "'true' can't be parsed properly", result ); + } + + // '1' test + { + bool result = libcmis::parseBool( string( "1" ) ); + CPPUNIT_ASSERT_MESSAGE( "'1' can't be parsed properly", result ); + } + + // 'false' test + { + bool result = libcmis::parseBool( string( "false" ) ); + CPPUNIT_ASSERT_MESSAGE( "'false' can't be parsed properly", !result ); + } + + // '0' test + { + bool result = libcmis::parseBool( string( "0" ) ); + CPPUNIT_ASSERT_MESSAGE( "'0' can't be parsed properly", !result ); + } + + // Error test + { + try + { + libcmis::parseBool( string( "boolcheat" ) ); + CPPUNIT_FAIL( "Exception should be thrown" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", + string( "Invalid xsd:boolean input: boolcheat" ), string( e.what() ) ); + } + } +} + +void XmlTest::parseIntegerTest( ) +{ + // Positive value test + { + long result = libcmis::parseInteger( string( "123" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Positive integer can't be parsed properly", 123L, result ); + } + + // Negative value test + { + long result = libcmis::parseInteger( string( "-123" ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Negative integer can't be parsed properly", -123L, result ); + } + + // Overflow error test + { + try + { + libcmis::parseInteger( string( "9999999999999999999" ) ); + CPPUNIT_FAIL( "Exception should be thrown" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", + string( "xsd:integer input can't fit to long: 9999999999999999999" ), string( e.what() ) ); + } + } + + // Non integer test + { + try + { + libcmis::parseInteger( string( "123bad" ) ); + CPPUNIT_FAIL( "Exception should be thrown" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", + string( "Invalid xsd:integer input: 123bad" ), string( e.what() ) ); + } + } +} + +void XmlTest::parseDoubleTest( ) +{ + // Positive value test + { + double result = libcmis::parseDouble( string( "123.456" ) ); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Positive decimal can't be parsed properly", 123.456, result, 0.000001 ); + } + + // Negative value test + { + double result = libcmis::parseDouble( string( "-123.456" ) ); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "Negative decimal can't be parsed properly", -123.456, result, 0.000001 ); + } + + // Non integer test + { + try + { + libcmis::parseDouble( string( "123.456bad" ) ); + CPPUNIT_FAIL( "Exception should be thrown" ); + } + catch ( const libcmis::Exception& e ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bad exception message", + string( "Invalid xsd:decimal input: 123.456bad" ), string( e.what() ) ); + } + } +} + +void XmlTest::parsePropertyStringTest( ) +{ + stringstream buf; + buf << "<cmis:propertyString " << getXmlns( ) + << "propertyDefinitionId=\"STR-ID\">" + << "<cmis:value>VALUE 1</cmis:value>" + << "<cmis:value>VALUE 2</cmis:value>" + << "</cmis:propertyString>"; + libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); + libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "STR-ID" ), actual->getPropertyType( )->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector<string>::size_type( 2 ), actual->getStrings( ).size( ) ); +} + +void XmlTest::parsePropertyIntegerTest( ) +{ + stringstream buf; + buf << "<cmis:propertyInteger " << getXmlns( ) + << "propertyDefinitionId=\"INT-ID\">" + << "<cmis:value>12345</cmis:value>" + << "<cmis:value>67890</cmis:value>" + << "</cmis:propertyInteger>"; + libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); + libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "INT-ID" ), actual->getPropertyType()->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector<string>::size_type( 2 ), actual->getLongs( ).size( ) ); +} + +void XmlTest::parsePropertyDateTimeTest( ) +{ + stringstream buf; + buf << "<cmis:propertyDateTime " << getXmlns( ) + << "propertyDefinitionId=\"DATE-ID\">" + << "<cmis:value>2012-01-19T09:06:57.388Z</cmis:value>" + << "<cmis:value>2011-01-19T09:06:57.388Z</cmis:value>" + << "</cmis:propertyDateTime>"; + libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); + libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "DATE-ID" ), actual->getPropertyType()->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector<string>::size_type( 2 ), actual->getDateTimes( ).size( ) ); +} + +void XmlTest::parsePropertyBoolTest( ) +{ + stringstream buf; + buf << "<cmis:propertyBoolean " << getXmlns( ) + << "propertyDefinitionId=\"BOOL-ID\">" + << "<cmis:value>true</cmis:value>" + << "</cmis:propertyBoolean>"; + libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); + libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "BOOL-ID" ), actual->getPropertyType()->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector<string>::size_type( 1 ), actual->getBools( ).size( ) ); +} + +void XmlTest::parseEmptyPropertyTest( ) +{ + stringstream buf; + buf << "<cmis:propertyId " << getXmlns( ) << "propertyDefinitionId=\"STR-ID\" />"; + libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); + libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), dummy ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "STR-ID" ), actual->getPropertyType()->getId( ) ); + CPPUNIT_ASSERT_MESSAGE( "Should have no value", actual->getStrings( ).empty( ) ); +} + +void XmlTest::parsePropertyNoTypeTest( ) +{ + stringstream buf; + buf << "<cmis:propertyDateTime " << getXmlns( ) + << "propertyDefinitionId=\"DATE-ID\">" + << "<cmis:value>2012-01-19T09:06:57.388Z</cmis:value>" + << "<cmis:value>2011-01-19T09:06:57.388Z</cmis:value>" + << "</cmis:propertyDateTime>"; + libcmis::ObjectTypePtr noType; + libcmis::PropertyPtr actual = libcmis::parseProperty( getXmlNode( buf.str( ) ), noType ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong id parsed", string( "DATE-ID" ), actual->getPropertyType()->getId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong number of values parsed", vector<string>::size_type( 2 ), actual->getDateTimes( ).size( ) ); +} + +void XmlTest::parseRenditionTest( ) +{ + stringstream buf; + buf << "<cmis:rendition " << getXmlns( ) << ">" + << "<cmis:streamId>STREAM-ID</cmis:streamId>" + << "<cmis:mimetype>MIME</cmis:mimetype>" + << "<cmis:length>123456</cmis:length>" + << "<cmis:kind>KIND</cmis:kind>" + << "<cmis:title>TITLE</cmis:title>" + << "<cmis:height>123</cmis:height>" + << "<cmis:width>456</cmis:width>" + << "<cmis:renditionDocumentId>DOC-ID</cmis:renditionDocumentId>" + << "</cmis:rendition>"; + libcmis::RenditionPtr actual( new libcmis::Rendition( getXmlNode( buf.str( ) ) ) ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong stream id parsed", string( "STREAM-ID" ), actual->getStreamId( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong mime type parsed", string( "MIME" ), actual->getMimeType( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong length parsed", long( 123456 ), actual->getLength( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong kind parsed", string( "KIND" ), actual->getKind( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong title parsed", string( "TITLE" ), actual->getTitle( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong height parsed", long( 123 ), actual->getHeight( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong width parsed", long( 456 ), actual->getWidth( ) ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong rendition doc id parsed", string( "DOC-ID" ), actual->getRenditionDocumentId( ) ); +} + +string lcl_findCapability( map< libcmis::Repository::Capability, string > store, libcmis::Repository::Capability capability ) +{ + string result; + map< libcmis::Repository::Capability, string >::iterator it = store.find( capability ); + if ( it != store.end( ) ) + result = it->second; + + return result; +} + +void XmlTest::parseRepositoryCapabilitiesTest( ) +{ + stringstream buf; + buf << "<cmis:capabilities " << getXmlns( ) << ">" + << "<cmis:capabilityACL>manage</cmis:capabilityACL>" + << "<cmis:capabilityAllVersionsSearchable>false</cmis:capabilityAllVersionsSearchable>" + << "<cmis:capabilityChanges>none</cmis:capabilityChanges>" + << "<cmis:capabilityContentStreamUpdatability>anytime</cmis:capabilityContentStreamUpdatability>" + << "<cmis:capabilityGetDescendants>true</cmis:capabilityGetDescendants>" + << "<cmis:capabilityGetFolderTree>true</cmis:capabilityGetFolderTree>" + << "<cmis:capabilityOrderBy>common</cmis:capabilityOrderBy>" + << "<cmis:capabilityMultifiling>true</cmis:capabilityMultifiling>" + << "<cmis:capabilityPWCSearchable>false</cmis:capabilityPWCSearchable>" + << "<cmis:capabilityPWCUpdatable>true</cmis:capabilityPWCUpdatable>" + << "<cmis:capabilityQuery>bothcombined</cmis:capabilityQuery>" + << "<cmis:capabilityRenditions>read</cmis:capabilityRenditions>" + << "<cmis:capabilityUnfiling>false</cmis:capabilityUnfiling>" + << "<cmis:capabilityVersionSpecificFiling>false</cmis:capabilityVersionSpecificFiling>" + << "<cmis:capabilityJoin>none</cmis:capabilityJoin>" + << "</cmis:capabilities>"; + + map< libcmis::Repository::Capability, string > capabilities = libcmis::Repository::parseCapabilities( getXmlNode( buf.str( ) ) ); + + CPPUNIT_ASSERT_EQUAL( string( "manage" ), lcl_findCapability( capabilities, libcmis::Repository::ACL ) ); + CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::AllVersionsSearchable ) ); + CPPUNIT_ASSERT_EQUAL( string( "none" ), lcl_findCapability( capabilities, libcmis::Repository::Changes ) ); + CPPUNIT_ASSERT_EQUAL( string( "anytime" ), lcl_findCapability( capabilities, libcmis::Repository::ContentStreamUpdatability ) ); + CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::GetDescendants ) ); + CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::GetFolderTree ) ); + CPPUNIT_ASSERT_EQUAL( string( "common" ), lcl_findCapability( capabilities, libcmis::Repository::OrderBy ) ); + CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::Multifiling ) ); + CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::PWCSearchable ) ); + CPPUNIT_ASSERT_EQUAL( string( "true" ), lcl_findCapability( capabilities, libcmis::Repository::PWCUpdatable ) ); + CPPUNIT_ASSERT_EQUAL( string( "bothcombined" ), lcl_findCapability( capabilities, libcmis::Repository::Query ) ); + CPPUNIT_ASSERT_EQUAL( string( "read" ), lcl_findCapability( capabilities, libcmis::Repository::Renditions ) ); + CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::Unfiling ) ); + CPPUNIT_ASSERT_EQUAL( string( "false" ), lcl_findCapability( capabilities, libcmis::Repository::VersionSpecificFiling ) ); + CPPUNIT_ASSERT_EQUAL( string( "none" ), lcl_findCapability( capabilities, libcmis::Repository::Join ) ); +} + +void XmlTest::propertyStringAsXmlTest( ) +{ + vector< string > values; + values.push_back( string( "Value 1" ) ); + values.push_back( string( "Value 2" ) ); + + ObjectTypeDummy factory; + map< string, libcmis::PropertyTypePtr >::iterator it = factory.getPropertiesTypes( ).find( "STR-ID" ); + CPPUNIT_ASSERT_MESSAGE( "Missing property type to setup fixture", it != factory.getPropertiesTypes( ).end() ); + libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); + + string actual = writeXml( property ); + + stringstream expected; + expected << "<?xml version=\"1.0\"?>\n" + << "<cmis:propertyString propertyDefinitionId=\"STR-ID\" localName=\"LOCAL\" displayName=\"DISPLAY\" queryName=\"QUERY\">" + << "<cmis:value>Value 1</cmis:value>" + << "<cmis:value>Value 2</cmis:value>" + << "</cmis:propertyString>\n"; + + CPPUNIT_ASSERT_EQUAL( expected.str( ), actual ); +} + +void XmlTest::propertyIntegerAsXmlTest( ) +{ + vector< string > values; + values.push_back( string( "123" ) ); + values.push_back( string( "456" ) ); + + ObjectTypeDummy factory; + map< string, libcmis::PropertyTypePtr >::iterator it = factory.getPropertiesTypes( ).find( "INT-ID" ); + CPPUNIT_ASSERT_MESSAGE( "Missing property type to setup fixture", it != factory.getPropertiesTypes( ).end() ); + libcmis::PropertyPtr property( new libcmis::Property( it->second, values ) ); + + string actual = writeXml( property ); + + stringstream expected; + expected << "<?xml version=\"1.0\"?>\n" + << "<cmis:propertyInteger propertyDefinitionId=\"INT-ID\" localName=\"LOCAL\" displayName=\"DISPLAY\" queryName=\"QUERY\">" + << "<cmis:value>123</cmis:value>" + << "<cmis:value>456</cmis:value>" + << "</cmis:propertyInteger>\n"; + + CPPUNIT_ASSERT_EQUAL( expected.str( ), actual ); +} + +void XmlTest::sha1Test( ) +{ + { + string actual = libcmis::sha1( "Hello" ); + CPPUNIT_ASSERT_EQUAL( string( "f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0" ), actual ); + } + + { + // check correct width + string actual = libcmis::sha1( "35969137" ); + CPPUNIT_ASSERT_EQUAL( string( "0d93546909cfeb5c00089202104df3980000ec9f" ), actual ); + } +} + +void XmlTest::propertyTypeUpdateTest( ) +{ + libcmis::PropertyType propDef( "datetime", "DATE-ID", "", "", "" ); + + libcmis::ObjectTypePtr dummy( new ObjectTypeDummy( ) ); + vector< libcmis::ObjectTypePtr > typeDefs; + typeDefs.push_back( dummy ); + + propDef.update( typeDefs ); + + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Not updated", + string( "LOCAL" ), propDef.getLocalName( ) ); + CPPUNIT_ASSERT_MESSAGE( "Property Type still marked temporary", + !propDef.m_temporary ); +} + +void XmlTest::escapeTest( ) +{ + string actual = libcmis::escape("something to escape$"); + CPPUNIT_ASSERT_EQUAL( string("something%20to%20escape%24"), actual); +} + +void XmlTest::unescapeTest( ) +{ + string actual = libcmis::unescape("something%20to%20escape%24"); + CPPUNIT_ASSERT_EQUAL( string("something to escape$"), actual); +} + +CPPUNIT_TEST_SUITE_REGISTRATION( XmlTest ); diff --git a/qa/mockup/Makefile.am b/qa/mockup/Makefile.am new file mode 100644 index 0000000..ef34e12 --- /dev/null +++ b/qa/mockup/Makefile.am @@ -0,0 +1,15 @@ +if !OS_WIN32 +noinst_LTLIBRARIES = libcmis-mockup.la + +libcmis_mockup_la_SOURCES = \ + curl-mockup.cxx \ + internals.hxx \ + mockup-config.cxx \ + mockup-config.h \ + curl/curl.h + +libcmis_mockup_la_LIBADD = \ + $(top_builddir)/src/libcmis/libcmis.la + +libcmis_mockup_la_LDFLAGS = -export-dynamic -no-undefined +endif diff --git a/qa/mockup/curl-mockup.cxx b/qa/mockup/curl-mockup.cxx new file mode 100644 index 0000000..0a74a64 --- /dev/null +++ b/qa/mockup/curl-mockup.cxx @@ -0,0 +1,504 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sstream> + +#include "curl/curl.h" +#include "internals.hxx" + +using namespace std; + +namespace mockup +{ + extern Configuration* config; +} + +/** Code mostly coming from curl + */ +struct curl_slist *curl_slist_append( struct curl_slist * list, const char * data ) +{ + struct curl_slist* new_item = ( struct curl_slist* ) malloc( sizeof( struct curl_slist ) ); + + if( new_item ) + { + char *dupdata = strdup(data); + if ( dupdata ) + { + new_item->next = NULL; + new_item->data = dupdata; + } + else + { + free(new_item); + return NULL; + } + } + else + return NULL; + + if ( list ) + { + curl_slist* last = list; + while ( last->next ) + last = last->next; + last->next = new_item; + return list; + } + + /* if this is the first item, then new_item *is* the list */ + return new_item; +} + +void curl_slist_free_all( struct curl_slist * list ) +{ + if ( list ) + { + struct curl_slist* item = list; + struct curl_slist* next = NULL; + do + { + next = item->next; + if ( item->data ) + free( item->data ); + free(item); + item = next; + } while ( next ); + } +} + +void curl_free( void * p ) +{ + free( p ); +} + +CURLcode curl_global_init( long ) +{ + return CURLE_OK; +} + +CURL *curl_easy_init( void ) +{ + return new CurlHandle(); +} + +void curl_easy_cleanup( CURL * curl ) +{ + CurlHandle* handle = static_cast< CurlHandle* >( curl ); + delete( handle ); +} + +void curl_easy_reset( CURL * curl ) +{ + CurlHandle* handle = static_cast< CurlHandle * >( curl ); + handle->reset( ); +} + +char *curl_easy_escape( CURL *, const char *string, int length ) +{ + return strndup( string, length ); +} + +char *curl_unescape( const char *string, int length ) +{ + return strndup( string, length ); +} + +char *curl_easy_unescape( CURL *, const char *string, int length, int * ) +{ + return curl_unescape( string, length ); +} + +CURLcode curl_easy_setopt( CURL * curl, long option, ... ) +{ + CurlHandle* handle = static_cast< CurlHandle * >( curl ); + + va_list arg; + va_start( arg, option ); + switch ( option ) + { + /* TODO Add support for more options */ + case CURLOPT_POST: + { + if ( va_arg( arg, long ) ) + handle->m_method = string( "POST" ); + break; + } + case CURLOPT_UPLOAD: + { + if ( 0 != va_arg( arg, long ) ) + handle->m_method = string( "PUT" ); + break; + } + case CURLOPT_CUSTOMREQUEST: + handle->m_method = string( va_arg( arg, char* ) ); + break; + case CURLOPT_URL: + { + handle->m_url = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_WRITEFUNCTION: + { + handle->m_writeFn = va_arg( arg, write_callback ); + break; + } + case CURLOPT_WRITEDATA: + { + handle->m_writeData = va_arg( arg, void* ); + break; + } + case CURLOPT_READFUNCTION: + { + handle->m_readFn = va_arg( arg, read_callback ); + break; + } + case CURLOPT_READDATA: + { + handle->m_readData = va_arg( arg, void* ); + break; + } + case CURLOPT_INFILESIZE: + { + handle->m_readSize = va_arg( arg, long ); + break; + } + case CURLOPT_HEADERFUNCTION: + { + handle->m_headersFn = va_arg( arg, headers_callback ); + break; + } + case CURLOPT_WRITEHEADER: + { + handle->m_headersData = va_arg( arg, void* ); + break; + } + case CURLOPT_USERNAME: + { + handle->m_username = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_PASSWORD: + { + handle->m_password = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_USERPWD: + { + string userpwd( va_arg( arg, char* ) ); + size_t pos = userpwd.find( ':' ); + if ( pos != string::npos ) + { + handle->m_username = userpwd.substr( 0, pos ); + handle->m_password = userpwd.substr( pos + 1 ); + } + break; + } + case CURLOPT_PROXY: + { + // FIXME curl does some more complex things with port and type + handle->m_proxy = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_NOPROXY: + { + handle->m_noProxy = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_PROXYUSERNAME: + { + handle->m_proxyUser = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_PROXYPASSWORD: + { + handle->m_proxyPass = string( va_arg( arg, char* ) ); + break; + } + case CURLOPT_PROXYUSERPWD: + { + string userpwd( va_arg( arg, char* ) ); + size_t pos = userpwd.find( ':' ); + if ( pos != string::npos ) + { + handle->m_proxyUser = userpwd.substr( 0, pos ); + handle->m_proxyPass = userpwd.substr( pos + 1 ); + } + break; + } + case CURLOPT_SSL_VERIFYHOST: + { + handle->m_verifyHost = va_arg( arg, long ) != 0; + break; + } + case CURLOPT_SSL_VERIFYPEER: + { + handle->m_verifyPeer = va_arg( arg, long ) != 0; + break; + } + case CURLOPT_CERTINFO: + { + handle->m_certInfo = va_arg( arg, long ); + break; + } + case CURLOPT_HTTPHEADER: + { + handle->m_headers.clear(); + struct curl_slist* headers = va_arg( arg, struct curl_slist* ); + while ( headers != NULL ) + { + handle->m_headers.push_back( string( headers->data ) ); + headers = headers->next; + } + break; + } + default: + { + // We surely don't want to break the test for that. + } + } + va_end( arg ); + + return CURLE_OK; +} + +CURLcode curl_easy_perform( CURL * curl ) +{ + CurlHandle* handle = static_cast< CurlHandle * >( curl ); + + /* Fake a bad SSL Certificate? */ + if ( !mockup::config->m_badSSLCertificate.empty( ) && handle->m_verifyPeer && handle->m_verifyHost ) + { + return CURLE_SSL_CACERT; + } + + /* Populate the certificate infos */ + if ( handle->m_certInfo && !mockup::config->m_badSSLCertificate.empty( ) ) + { + curl_slist * certData = NULL; + string cert( "Cert:" + mockup::config->m_badSSLCertificate ); + char* c_cert = strdup( cert.c_str( ) ); + certData = curl_slist_append( certData, c_cert ); + free( c_cert ); + + handle->m_certs.num_of_certs = 1; + handle->m_certs.certinfo = ( struct curl_slist** )calloc( ( size_t )1, sizeof( struct curl_slist * ) ); + handle->m_certs.certinfo[0] = certData; + } + + /* Check the credentials */ + if ( mockup::config->hasCredentials( ) && + ( handle->m_username != mockup::config->m_username || + handle->m_password != mockup::config->m_password ) ) + { + // Send HTTP 401 + handle->m_httpError = 401; + return CURLE_HTTP_RETURNED_ERROR; + } + + // Store the requests for later verifications + stringstream body; + if ( handle->m_readFn && handle->m_readData ) + { + size_t bufSize = 2048; + char* buf = new char[bufSize]; + + size_t read = 0; + do + { + read = handle->m_readFn( buf, 1, bufSize, handle->m_readData ); + body.write( buf, read ); + } while ( read == bufSize ); + + delete[] buf; + } + + mockup::config->m_requests.push_back( mockup::Request( handle->m_url, handle->m_method, body.str( ), handle->m_headers ) ); + + + return mockup::config->writeResponse( handle ); +} + +CURLcode curl_easy_getinfo( CURL * curl, long info, ... ) +{ + CurlHandle* handle = static_cast< CurlHandle * >( curl ); + + va_list arg; + va_start( arg, info ); + switch ( info ) + { + case CURLINFO_RESPONSE_CODE: + { + long* buf = va_arg( arg, long* ); + *buf = handle->m_httpError; + break; + } + case CURLINFO_CERTINFO: + { + struct curl_slist** param = va_arg( arg, struct curl_slist** ); + if ( NULL != param ) + { + union + { + struct curl_certinfo * to_certinfo; + struct curl_slist * to_slist; + } ptr; + + // Fill it + ptr.to_certinfo = &handle->m_certs; + *param = ptr.to_slist; + } + break; + } + default: + { + // We surely don't want to break the test for that. + } + } + va_end( arg ); + + return CURLE_OK; +} + +CurlHandle::CurlHandle( ) : + m_url( ), + m_writeFn( NULL ), + m_writeData( NULL ), + m_readFn( NULL ), + m_readData( NULL ), + m_readSize( 0 ), + m_headersFn( NULL ), + m_headersData( NULL ), + m_username( ), + m_password( ), + m_proxy( ), + m_noProxy( ), + m_proxyUser( ), + m_proxyPass( ), + m_verifyHost( true ), + m_verifyPeer( true ), + m_certInfo( false ), + m_certs( ), + m_httpError( 0 ), + m_method( "GET" ), + m_headers( ) +{ +} + +CurlHandle::CurlHandle( const CurlHandle& copy ) : + m_url( copy.m_url ), + m_writeFn( copy.m_writeFn ), + m_writeData( copy.m_writeData ), + m_readFn( copy.m_readFn ), + m_readData( copy.m_readData ), + m_readSize( copy.m_readSize ), + m_headersFn( copy.m_headersFn ), + m_headersData( copy.m_headersData ), + m_username( copy.m_username ), + m_password( copy.m_password ), + m_proxy( copy.m_proxy ), + m_noProxy( copy.m_noProxy ), + m_proxyUser( copy.m_proxyUser ), + m_proxyPass( copy.m_proxyPass ), + m_verifyHost( copy.m_verifyHost ), + m_verifyPeer( copy.m_verifyPeer ), + m_certInfo( copy.m_certInfo ), + m_certs( copy.m_certs ), + m_httpError( copy.m_httpError ), + m_method( copy.m_method ), + m_headers( copy.m_headers ) +{ +} + +CurlHandle& CurlHandle::operator=( const CurlHandle& copy ) +{ + if ( this != © ) + { + m_url = copy.m_url; + m_writeFn = copy.m_writeFn; + m_writeData = copy.m_writeData; + m_readFn = copy.m_readFn; + m_readData = copy.m_readData; + m_readSize = copy.m_readSize; + m_headersFn = copy.m_headersFn; + m_headersData = copy.m_headersData; + m_username = copy.m_username; + m_password = copy.m_password; + m_proxy = copy.m_proxy; + m_noProxy = copy.m_noProxy; + m_proxyUser = copy.m_proxyUser; + m_proxyPass = copy.m_proxyPass; + m_verifyHost = copy.m_verifyHost; + m_verifyPeer = copy.m_verifyPeer; + m_certInfo = copy.m_certInfo; + m_certs = copy.m_certs; + m_httpError = copy.m_httpError; + m_method = copy.m_method; + m_headers = copy.m_headers; + } + return *this; +} + +CurlHandle::~CurlHandle( ) +{ + reset(); +} + +void CurlHandle::reset( ) +{ + m_url = string( ); + m_writeFn = NULL; + m_writeData = NULL; + m_readFn = NULL; + m_readData = NULL; + m_readSize = 0; + m_username = string( ); + m_password = string( ); + m_proxy = string( ); + m_noProxy = string( ); + m_proxyUser = string( ); + m_proxyPass = string( ); + m_verifyHost = true; + m_verifyPeer = true; + m_certInfo = false; + + for ( int i = 0; i < m_certs.num_of_certs; ++i ) + { + curl_slist_free_all( m_certs.certinfo[i] ); + m_certs.certinfo[i] = NULL; + } + free( m_certs.certinfo ); + m_certs.certinfo = NULL; + m_certs.num_of_certs = 0; + + m_method = "GET"; + m_headers.clear( ); +} diff --git a/qa/mockup/curl/curl.h b/qa/mockup/curl/curl.h new file mode 100644 index 0000000..50f1cfe --- /dev/null +++ b/qa/mockup/curl/curl.h @@ -0,0 +1,153 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ +#ifndef _MOCKUP_CURL_CURL_H_ +#define _MOCKUP_CURL_CURL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Curl used symbols to mockup */ + +typedef void CURL; + +typedef enum +{ + CURLIOE_OK, /* I/O operation successful */ + CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ + CURLIOE_FAILRESTART, /* failed to restart the read */ + CURLIOE_LAST /* never use */ +} curlioerr; + +#define CURL_GLOBAL_SSL (1<<0) +#define CURL_GLOBAL_WIN32 (1<<1) +#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) + +#define CURLOPTTYPE_LONG 0 +#define CURLOPTTYPE_OBJECTPOINT 10000 +#define CURLOPTTYPE_FUNCTIONPOINT 20000 +#define CURLOPTTYPE_OFF_T 30000 + +typedef enum +{ + CURLOPT_WRITEFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 11, + CURLOPT_READFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 12, + CURLOPT_WRITEDATA = CURLOPTTYPE_OBJECTPOINT + 1, + CURLOPT_HEADERFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 79, + CURLOPT_WRITEHEADER = CURLOPTTYPE_OBJECTPOINT + 29, + CURLOPT_FOLLOWLOCATION = CURLOPTTYPE_LONG + 52, + CURLOPT_MAXREDIRS = CURLOPTTYPE_LONG + 68, + CURLOPT_INFILESIZE = CURLOPTTYPE_LONG + 14, + CURLOPT_READDATA = CURLOPTTYPE_OBJECTPOINT + 9, + CURLOPT_UPLOAD = CURLOPTTYPE_LONG + 46, + CURLOPT_IOCTLFUNCTION = CURLOPTTYPE_FUNCTIONPOINT + 130, + CURLOPT_IOCTLDATA = CURLOPTTYPE_OBJECTPOINT + 131, + CURLOPT_HTTPHEADER = CURLOPTTYPE_OBJECTPOINT + 23, + CURLOPT_POSTFIELDSIZE = CURLOPTTYPE_LONG + 60, + CURLOPT_POST = CURLOPTTYPE_LONG + 47, + CURLOPT_CUSTOMREQUEST = CURLOPTTYPE_OBJECTPOINT + 36, + CURLOPT_URL = CURLOPTTYPE_OBJECTPOINT + 2, + CURLOPT_HTTPAUTH = CURLOPTTYPE_LONG + 107, + CURLOPT_USERNAME = CURLOPTTYPE_OBJECTPOINT + 173, + CURLOPT_PASSWORD = CURLOPTTYPE_OBJECTPOINT + 174, + CURLOPT_USERPWD = CURLOPTTYPE_OBJECTPOINT + 5, + CURLOPT_ERRORBUFFER = CURLOPTTYPE_OBJECTPOINT + 10, + CURLOPT_FAILONERROR = CURLOPTTYPE_LONG + 45, + CURLOPT_VERBOSE = CURLOPTTYPE_LONG + 41, + CURLOPT_PROXY = CURLOPTTYPE_OBJECTPOINT + 4, + CURLOPT_PROXYUSERPWD = CURLOPTTYPE_OBJECTPOINT + 6, + CURLOPT_PROXYAUTH = CURLOPTTYPE_LONG + 111, + CURLOPT_PROXYUSERNAME = CURLOPTTYPE_OBJECTPOINT + 175, + CURLOPT_PROXYPASSWORD = CURLOPTTYPE_OBJECTPOINT + 176, + CURLOPT_NOPROXY = CURLOPTTYPE_OBJECTPOINT + 177, + CURLOPT_SSL_VERIFYPEER = CURLOPTTYPE_LONG + 64, + CURLOPT_SSL_VERIFYHOST = CURLOPTTYPE_LONG + 81, + CURLOPT_CERTINFO = CURLOPTTYPE_LONG + 172 +} CURLoption; + +#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) +#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) + +typedef enum +{ + CURLE_OK = 0, + CURLE_HTTP_RETURNED_ERROR = 22, + CURLE_SSL_CACERT = 60, + /* TODO Add some more error codes from curl? */ + CURL_LAST +} CURLcode; + +struct curl_slist +{ + char *data; + struct curl_slist *next; +}; + +struct curl_slist *curl_slist_append( struct curl_slist *, const char * ); +void curl_slist_free_all( struct curl_slist * ); + +void curl_free( void *p ); +CURLcode curl_global_init( long flags ); + +CURL *curl_easy_init( void ); +void curl_easy_cleanup( CURL *curl ); +CURLcode curl_easy_setopt( CURL *curl, long option, ... ); +char *curl_easy_escape( CURL *handle, const char *string, int length ); +char *curl_unescape( const char *string, int length ); +char *curl_easy_unescape( CURL *handle, const char *string, int length, int *outlength ); +CURLcode curl_easy_perform( CURL *curl ); +void curl_easy_reset( CURL *curl ); + +struct curl_certinfo +{ + int num_of_certs; + struct curl_slist **certinfo; +}; + +#define CURLINFO_LONG 0x200000 +#define CURLINFO_SLIST 0x400000 + +typedef enum +{ + CURLINFO_NONE, + CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, + CURLINFO_CERTINFO = CURLINFO_SLIST + 34, + CURLINFO_LASTONE = 42 +} CURLINFO; + +CURLcode curl_easy_getinfo( CURL *curl, long info, ... ); + +#define LIBCURL_VERSION_MAJOR 7 +#define LIBCURL_VERSION_MINOR 26 +#define LIBCURL_VERSION_PATCH 0 + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/qa/mockup/internals.hxx b/qa/mockup/internals.hxx new file mode 100644 index 0000000..43c001e --- /dev/null +++ b/qa/mockup/internals.hxx @@ -0,0 +1,133 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#ifndef INCLUDED_QA_MOCKUP_INTERNALS_HXX +#define INCLUDED_QA_MOCKUP_INTERNALS_HXX + +#include <map> +#include <string> +#include <vector> + +typedef size_t ( *write_callback )( char *ptr, size_t size, size_t nmemb, void *userdata ); +typedef size_t ( *read_callback )( char *ptr, size_t size, size_t nmemb, void *userdata ); +typedef size_t ( *headers_callback )( char *ptr, size_t size, size_t nmemb, void *userdata ); + +class CurlHandle +{ + public: + CurlHandle( ); + CurlHandle( const CurlHandle& copy ); + CurlHandle& operator=( const CurlHandle& copy ); + ~CurlHandle( ); + + std::string m_url; + + write_callback m_writeFn; + void* m_writeData; + read_callback m_readFn; + void* m_readData; + long m_readSize; + headers_callback m_headersFn; + void* m_headersData; + + std::string m_username; + std::string m_password; + std::string m_proxy; + std::string m_noProxy; + std::string m_proxyUser; + std::string m_proxyPass; + + bool m_verifyHost; + bool m_verifyPeer; + bool m_certInfo; + + struct curl_certinfo m_certs; + + long m_httpError; + std::string m_method; + std::vector< std::string > m_headers; + + void reset( ); +}; + +namespace mockup +{ + class Response + { + public: + Response( std::string response, unsigned int status, bool isFilePath, + std::string headers ); + + std::string m_response; + unsigned int m_status; + bool m_isFilePath; + std::string m_headers; + }; + + class Request + { + public: + Request( std::string url, std::string method, std::string body, + std::vector< std::string > headers ); + + std::string m_url; + std::string m_method; + std::string m_body; + std::vector< std::string > m_headers; + }; + + class RequestMatcher + { + public: + RequestMatcher( std::string baseUrl, std::string matchParam, + std::string method, std::string matchBody ); + bool operator< ( const RequestMatcher& compare ) const; + + std::string m_baseUrl; + std::string m_matchParam; + std::string m_method; + std::string m_matchBody; + }; + + class Configuration + { + public: + Configuration( ); + + bool hasCredentials( ); + CURLcode writeResponse( CurlHandle* handle ); + + std::map< RequestMatcher, Response > m_responses; + std::vector< Request > m_requests; + std::string m_username; + std::string m_password; + std::string m_badSSLCertificate; + }; +} + +#endif diff --git a/qa/mockup/mockup-config.cxx b/qa/mockup/mockup-config.cxx new file mode 100644 index 0000000..7678518 --- /dev/null +++ b/qa/mockup/mockup-config.cxx @@ -0,0 +1,409 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include "mockup-config.h" + +#include <memory> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <iostream> + +#include <boost/algorithm/string.hpp> + +#include "internals.hxx" + +using namespace std; + +namespace +{ + void lcl_splitUrl( const string& url, string& urlBase, string& params ) + { + size_t pos = url.find( "?" ); + urlBase = url; + if ( pos != string::npos ) + { + urlBase = url.substr( 0, pos ); + params = url.substr( pos + 1 ); + } + } + + const char** lcl_toStringArray( const vector< string >& vect ) + { + const char** array = new const char*[vect.size() + 1]; + for ( size_t i = 0; i < vect.size( ); i++ ) + array[i] = vect[i].c_str(); + array[vect.size()] = NULL; + return array; + } +} + +namespace mockup +{ + Response::Response( string response, unsigned int status, bool isFilePath, string headers ) : + m_response( response ), + m_status( status ), + m_isFilePath( isFilePath ), + m_headers( headers ) + { + } + + Request::Request( string url, string method, string body, vector< string > headers ) : + m_url( url ), + m_method( method ), + m_body( body ), + m_headers( headers ) + { + } + + RequestMatcher::RequestMatcher( string baseUrl, string matchParam, string method, string matchBody ) : + m_baseUrl( baseUrl ), + m_matchParam( matchParam ), + m_method( method ), + m_matchBody( matchBody ) + { + } + + bool RequestMatcher::operator< ( const RequestMatcher& compare ) const + { + int cmpBaseUrl = m_baseUrl.compare( compare.m_baseUrl ) ; + if ( cmpBaseUrl != 0 ) + return cmpBaseUrl < 0; + + int cmpMatchParam = m_matchParam.compare( compare.m_matchParam ); + if ( cmpMatchParam != 0 ) + return cmpMatchParam < 0; + + int cmpMatchMethod = m_method.compare( compare.m_method ); + if ( cmpMatchMethod != 0 ) + return cmpMatchMethod < 0; + + int cmpMatchBody = m_matchBody.compare( compare.m_matchBody ); + return cmpMatchBody < 0; + } + + Configuration::Configuration( ) : + m_responses( ), + m_requests( ), + m_username( ), + m_password( ), + m_badSSLCertificate( ) + { + } + + bool Configuration::hasCredentials( ) + { + return !m_username.empty( ) && !m_password.empty( ); + } + + /** Find a suitable response + * using the request as a search key + */ + CURLcode Configuration::writeResponse( CurlHandle* handle ) + { + CURLcode code = CURLE_OK; + + string headers; + string response; + bool foundResponse = false; + bool isFilePath = true; + const string& url = handle->m_url; + + string urlBase = url; + string params; + lcl_splitUrl( url, urlBase, params ); + string method = handle->m_method; + string body = m_requests.back().m_body; + + for ( map< RequestMatcher, Response >::iterator it = m_responses.begin( ); + it != m_responses.end( ) && response.empty( ); ++it ) + { + RequestMatcher matcher = it->first; + string& paramFind = matcher.m_matchParam; + bool matchBaseUrl = matcher.m_baseUrl.empty() || ( urlBase == matcher.m_baseUrl ); + bool matchParams = paramFind.empty( ) || ( params.find( paramFind ) != string::npos ); + bool matchMethod = it->first.m_method.empty( ) || ( it->first.m_method == method ); + bool matchBody = matcher.m_matchBody.empty( ) || ( body.find( matcher.m_matchBody ) != string::npos ); + + if ( matchBaseUrl && matchParams && matchMethod && matchBody ) + { + foundResponse = true; + response = it->second.m_response; + handle->m_httpError = it->second.m_status; + isFilePath = it->second.m_isFilePath; + headers = it->second.m_headers; + } + } + + // Output headers is any + if ( !headers.empty() ) + { + char* buf = strdup( headers.c_str() ); + handle->m_headersFn( buf, 1, headers.size( ), handle->m_headersData ); + free( buf ); + } + + // If nothing matched, then send a 404 HTTP error instead + if ( !foundResponse || ( foundResponse && isFilePath && response.empty() ) ) + handle->m_httpError = 404; + else + { + if ( isFilePath ) + { + FILE* fd = fopen( response.c_str( ), "r" ); + if ( !fd ) { + cerr << "Missing test file: " << response << endl; + handle->m_httpError = 500; + return CURLE_HTTP_RETURNED_ERROR; + } + + + size_t bufSize = 2048; + char* buf = new char[bufSize]; + + size_t read = 0; + size_t written = 0; + do + { + read = fread( buf, 1, bufSize, fd ); + written = handle->m_writeFn( buf, 1, read, handle->m_writeData ); + } while ( read == bufSize && written == read ); + + fclose( fd ); + delete[] buf; + } + else + { + if ( !response.empty() ) + { + char* buf = strdup( response.c_str() ); + handle->m_writeFn( buf, 1, response.size( ), handle->m_writeData ); + free( buf ); + } + } + } + + // What curl error code to give? + if ( handle->m_httpError == 0 ) + handle->m_httpError = 200; + + if ( handle->m_httpError < 200 || handle->m_httpError >= 300 ) + code = CURLE_HTTP_RETURNED_ERROR; + + return code; + } + + unique_ptr<Configuration> config{ new Configuration( ) }; +} + +void curl_mockup_reset( ) +{ + mockup::config.reset( new mockup::Configuration( ) ); +} + +void curl_mockup_addResponse( const char* urlBase, const char* matchParam, const char* method, + const char* response, unsigned int status, bool isFilePath, + const char* headers, const char* matchBody ) +{ + string matchBodyStr; + if ( matchBody ) + matchBodyStr = matchBody; + mockup::RequestMatcher matcher( urlBase, matchParam, method, matchBodyStr ); + map< mockup::RequestMatcher, mockup::Response >::iterator it = mockup::config->m_responses.find( matcher ); + if ( it != mockup::config->m_responses.end( ) ) + mockup::config->m_responses.erase( it ); + + string headersStr; + if ( headers != NULL ) + headersStr = headers; + mockup::Response responseDesc( response, status, isFilePath, headersStr ); + mockup::config->m_responses.insert( pair< mockup::RequestMatcher, mockup::Response >( matcher, responseDesc ) ); +} + +void curl_mockup_setResponse( const char* filepath ) +{ + mockup::config->m_responses.clear( ); + curl_mockup_addResponse( "", "", "", filepath ); +} + +void curl_mockup_setCredentials( const char* username, const char* password ) +{ + mockup::config->m_username = string( username ); + mockup::config->m_password = string( password ); +} + +const struct HttpRequest* curl_mockup_getRequest( const char* urlBase, + const char* matchParam, + const char* method, + const char* matchBody ) +{ + struct HttpRequest* request = NULL; + + string urlBaseString( urlBase ); + string matchParamString( matchParam ); + + string matchBodyStr; + if ( matchBody ) + matchBodyStr = matchBody; + + for ( vector< mockup::Request >::iterator it = mockup::config->m_requests.begin( ); + it != mockup::config->m_requests.end( ) && request == NULL; ++it ) + { + string url; + string params; + if ( it->m_method == string( method ) ) + { + lcl_splitUrl( it->m_url, url, params ); + + bool matchBaseUrl = urlBaseString.empty() || boost::starts_with( url, urlBaseString ); + bool matchParams = matchParamString.empty( ) || ( params.find( matchParamString ) != string::npos ); + bool matchBodyPart = !matchBody || ( it->m_body.find( matchBodyStr ) != string::npos ); + + if ( matchBaseUrl && matchParams && matchBodyPart ) + { + request = new HttpRequest; + request->url = it->m_url.c_str(); + request->body = it->m_body.c_str(); + request->headers = lcl_toStringArray( it->m_headers ); + } + } + } + + return request; +} + +const char* curl_mockup_getRequestBody( const char* urlBase, + const char* matchParam, + const char* method, + const char* matchBody ) +{ + const struct HttpRequest* request = curl_mockup_getRequest( urlBase, matchParam, method, matchBody ); + if ( request ) + { + const char* body = request->body; + curl_mockup_HttpRequest_free( request ); + return body; + } + return NULL; +} + +int curl_mockup_getRequestsCount( const char* urlBase, + const char* matchParam, + const char* method, + const char* matchBody ) +{ + int count = 0; + + string urlBaseString( urlBase ); + string matchParamString( matchParam ); + string matchBodyStr( matchBody ); + + for ( vector< mockup::Request >::iterator it = mockup::config->m_requests.begin( ); + it != mockup::config->m_requests.end( ); ++it ) + { + string url; + string params; + if ( it->m_method == string( method ) ) + { + lcl_splitUrl( it->m_url, url, params ); + + bool matchBaseUrl = urlBaseString.empty() || boost::starts_with( url, urlBaseString ); + bool matchParams = matchParamString.empty( ) || + ( params.find( matchParamString ) != string::npos ); + bool matchBodyPart = matchBodyStr.empty() || + ( it->m_body.find( matchBodyStr ) != string::npos ); + + if ( matchBaseUrl && matchParams && matchBodyPart ) + { + count++; + } + } + } + return count; +} + +void curl_mockup_HttpRequest_free( const struct HttpRequest* request ) +{ + delete[] request->headers; + delete request; +} + +char* curl_mockup_HttpRequest_getHeader( const struct HttpRequest* request, const char* name ) +{ + char* value = NULL; + size_t i = 0; + while ( request->headers[i] != NULL && value == NULL ) + { + string header = request->headers[i]; + const string prefix = string( name ) + ":"; + size_t pos = header.find( prefix ); + if ( pos == 0 ) + { + value = strdup( header.substr( prefix.size() ).c_str() ); + } + ++i; + } + return value; +} + +const char* curl_mockup_getProxy( CURL* curl ) +{ + CurlHandle* handle = static_cast< CurlHandle* >( curl ); + if ( NULL != handle ) + return handle->m_proxy.c_str(); + return NULL; +} + +const char* curl_mockup_getNoProxy( CURL* curl ) +{ + CurlHandle* handle = static_cast< CurlHandle* >( curl ); + if ( NULL != handle ) + return handle->m_noProxy.c_str(); + return NULL; +} + +const char* curl_mockup_getProxyUser( CURL* curl ) +{ + CurlHandle* handle = static_cast< CurlHandle* >( curl ); + if ( NULL != handle ) + return handle->m_proxyUser.c_str(); + return NULL; +} + +const char* curl_mockup_getProxyPass( CURL* curl ) +{ + CurlHandle* handle = static_cast< CurlHandle* >( curl ); + if ( NULL != handle ) + return handle->m_proxyPass.c_str(); + return NULL; +} + +void curl_mockup_setSSLBadCertificate( const char* certificate ) +{ + mockup::config->m_badSSLCertificate = string( certificate ); +} diff --git a/qa/mockup/mockup-config.h b/qa/mockup/mockup-config.h new file mode 100644 index 0000000..d0fc3bb --- /dev/null +++ b/qa/mockup/mockup-config.h @@ -0,0 +1,113 @@ +/* libcmis + * Version: MPL 1.1 / GPLv2+ / LGPLv2+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 SUSE <cbosdonnat@suse.com> + * + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPLv2+"), or + * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"), + * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable + * instead of those above. + */ + +#include <curl/curl.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Mockup behavior configuration functions */ +void curl_mockup_reset( ); + +/** Add a new HTTP response the server should send. + + \param baseURL + the base URL of the request without parameters + \param matchParam + a string to find in the parameters part of the URL to match + \param method + HTTP method to match like PUT, GET, POST or DELETE. An empty + string matches any method. + \param response + a string corresponding either to the file path of the request + body to send or directly the content to send. This value has + a different meaning depending on isFilePath parameter. + \param status + the HTTP status to return. 0 means HTTP OK (200). + \param isFilePath + if this value is true the response value is used as a file path, + otherwise, the response value is used as the body of the HTTP + response to send. + \param headers + the HTTP headers block to send with the response. By default + no header is sent. + \param matchBody + a string to find in the request body to match + */ +void curl_mockup_addResponse( const char* baseUrl, const char* matchParam, const char* method, + const char* response, unsigned int status = 0, bool isFilePath = true, + const char* headers = 0, const char* matchBody = 0 ); + +/** Set the HTTP response the server is supposed to send. + This will reset all already defined responses. + */ +void curl_mockup_setResponse( const char* filepath ); +void curl_mockup_setCredentials( const char* username, const char* password ); + +struct HttpRequest +{ + const char* url; + const char* body; + ///< NULL terminated array of headers. + const char** headers; +}; + +const struct HttpRequest* curl_mockup_getRequest( const char* baseUrl, + const char* matchParam, + const char* method, + const char* matchBody = 0 ); +const char* curl_mockup_getRequestBody( const char* baseUrl, + const char* matchParam, + const char* method, + const char* matchBody = 0 ); +int curl_mockup_getRequestsCount( const char* urlBase, + const char* matchParam, + const char* method, + const char* matchBody = "" ); + +void curl_mockup_HttpRequest_free( const struct HttpRequest* request ); + +/** The resulting value is either NULL (no such header found) or the value + of the header. In such a case, the result needs to be freed by the caller. + */ +char* curl_mockup_HttpRequest_getHeader( const struct HttpRequest* request, const char* name ); + +const char* curl_mockup_getProxy( CURL* handle ); +const char* curl_mockup_getNoProxy( CURL* handle ); +const char* curl_mockup_getProxyUser( CURL* handle ); +const char* curl_mockup_getProxyPass( CURL* handle ); + +/** Set a fake invalid certificate to raise CURLE_SSL_CACERT. Setting it + to an empty string will reset to no certificate. + */ +void curl_mockup_setSSLBadCertificate( const char* certificate ); + +#ifdef __cplusplus +} +#endif |