File indexing completed on 2024-12-29 04:49:08

0001 // TODO: this file is unused, but should be converted to C++ in order to add these tests to synctest.cpp
0002 
0003 Resource.setType( "akonadi_maildir_resource" );
0004 
0005 // read test
0006 Resource.setPathOption( "Path", "maildir/root" );
0007 Resource.create();
0008 
0009 XmlOperations.setXmlFile( "maildir.xml" );
0010 XmlOperations.setRootCollections( Resource.identifier() );
0011 XmlOperations.setNormalizeRemoteIds( true );
0012 XmlOperations.ignoreCollectionField( "Name" );
0013 XmlOperations.assertEqual();
0014 
0015 Resource.destroy();
0016 
0017 // empty maildir
0018 Resource.setPathOption( "Path", "newmaildir" );
0019 Resource.create();
0020 
0021 XmlOperations.setXmlFile( "maildir-empty.xml" );
0022 XmlOperations.setRootCollections( Resource.identifier() );
0023 XmlOperations.assertEqual();
0024 
0025 // folder creation
0026 CollectionTest.setParent( Resource.identifier() );
0027 CollectionTest.addContentType( "message/rfc822" );
0028 CollectionTest.setName( "test folder" );
0029 CollectionTest.create();
0030 
0031 // item creation
0032 ItemTest.setParentCollection( Resource.identifier() + "/test folder" );
0033 ItemTest.setMimeType( "message/rfc822" );
0034 ItemTest.setPayloadFromFile( "testmail.mbox" );
0035 ItemTest.create();
0036 
0037 Resource.recreate();
0038 
0039 XmlOperations.setXmlFile( "maildir-step1.xml" );
0040 XmlOperations.setRootCollections( Resource.identifier() );
0041 XmlOperations.setItemKey( "None" );
0042 XmlOperations.ignoreItemField( "RemoteId" );
0043 XmlOperations.assertEqual();
0044 
0045 // folder modification
0046 CollectionTest.setCollection( Resource.identifier() + "/test folder" );
0047 CollectionTest.setName( "changed folder" );
0048 CollectionTest.update();
0049 
0050 Resource.recreate();
0051 
0052 XmlOperations.setXmlFile( "maildir-step2.xml" );
0053 XmlOperations.setRootCollections( Resource.identifier() );
0054 XmlOperations.assertEqual();
0055 
0056 // folder deletion 
0057 CollectionTest.setCollection( Resource.identifier() + "/changed folder" );
0058 CollectionTest.remove();
0059 
0060 Resource.recreate();
0061 
0062 XmlOperations.setXmlFile( "maildir-empty.xml" );
0063 XmlOperations.setRootCollections( Resource.identifier() );
0064 XmlOperations.assertEqual();
0065