org.opencms.file
Class TestSiblings

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.opencms.test.OpenCmsTestCase
              extended by org.opencms.file.TestSiblings
All Implemented Interfaces:
junit.framework.Test

public class TestSiblings
extends OpenCmsTestCase

Unit test for operations on siblings.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.opencms.test.OpenCmsTestCase
OpenCmsTestCase.ConnectionData
 
Field Summary
 
Fields inherited from class org.opencms.test.OpenCmsTestCase
ARTICLE_TYPEID, DB_MYSQL, DB_ORACLE, m_additionalConnection, m_configuration, m_currentResourceStrorage, m_defaultConnection, m_defaultTablespace, m_indexTablespace, m_resourceStorages, m_setupConnection, m_tempTablespace
 
Constructor Summary
TestSiblings(String arg0)
          Default JUnit constructor.
 
Method Summary
static void copyResourceAsSibling(OpenCmsTestCase tc, CmsObject cms, String source, String target)
          Creates a copy of a resource as a new sibling.
static void createSibling(OpenCmsTestCase tc, CmsObject cms, String source, String target)
          Creates a new sibling of a resource.
static junit.framework.Test suite()
          Test suite for this test class.
 void testDeleteAllSiblings()
          Tests deletion of a resource together with all siblings.
 void testSiblingIssueAfterImport()
          Error scenario where an import is deleted that contains siblings inside the same folders.
 void testSiblingProjects()
          Tests the "project last modified" state with sibling operations across different projects.
 void testSiblingsCopy()
          Tests the "copy as new sibling" function.
 void testSiblingsCreate()
          Tests the "copy as new sibling" function.
 void testSiblingsCreateIssue()
          Tests creating 2 new siblings and publishing just one of them.
 void testSiblingsNewDeletePublishIssue()
          Tests an issue, where there is an error in OpenCms V7 when publishing two siblings of the same resource.
 void testSiblingsRelations()
          Tests the link management features with siblings.
 void testSiblingStateIssue()
          Tests if setting the flags of a sibling will do any modifications to other siblings.
 void testSiblingsV7PublishIssue()
          Tests an issue present in OpenCms 7 where online content was not replaced after publish.
 
Methods inherited from class org.opencms.test.OpenCmsTestCase
addTestDataPath, assertAce, assertAcl, assertAcl, assertContains, assertContainsNot, assertContent, assertDateContent, assertDateContentAfter, assertDateCreated, assertDateCreatedAfter, assertDateExpired, assertDateLastModified, assertDateLastModifiedAfter, assertDateReleased, assertEquals, assertEquals, assertEquals, assertFilter, assertFilter, assertFilter, assertFilter, assertFlags, assertHistory, assertHistoryForRestored, assertIsFolder, assertIsIdentical, assertIsNotIdentical, assertLock, assertLock, assertLock, assertModifiedInCurrentProject, assertPermissionString, assertProject, assertPropertyChanged, assertPropertyChanged, assertPropertydefinitionExist, assertPropertydefinitions, assertPropertyEqual, assertPropertyNew, assertPropertyNew, assertPropertyRemoved, assertPropertyRemoved, assertRelation, assertResourceId, assertResourceType, assertSiblingCount, assertSiblingCountIncremented, assertState, assertStructureId, assertType, assertUserCreated, assertUserLastModified, assertVersion, checkErrors, createStorage, deleteFile, echo, generateContent, generateContent, generateName, generateProperties, generateResources, generateSetupTestWrapper, generateUsers, getCmsObject, getConnectionName, getDatabaseProduct, getDbProduct, getPreCalculatedState, getReplacer, getSetupDataPath, getSetupDb, getTestDataPath, importData, importResources, importTestResource, initTestDataPath, removeDatabase, removeDatabase, removeOpenCms, removeStorage, resetMapping, restart, restartOpenCms, setMapping, setupDatabase, setupDatabase, setupOpenCms, setupOpenCms, setupOpenCms, setupOpenCms, setupOpenCms, storeResources, storeResources, switchStorage
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestSiblings

public TestSiblings(String arg0)
Default JUnit constructor.

Parameters:
arg0 - JUnit parameters
Method Detail

copyResourceAsSibling

public static void copyResourceAsSibling(OpenCmsTestCase tc,
                                         CmsObject cms,
                                         String source,
                                         String target)
                                  throws Exception
Creates a copy of a resource as a new sibling.

Parameters:
tc - the OpenCms test case
cms - the current user's Cms object
source - path/resource name of the existing resource
target - path/resource name of the new sibling
Throws:
Exception - if something goes wrong

createSibling

public static void createSibling(OpenCmsTestCase tc,
                                 CmsObject cms,
                                 String source,
                                 String target)
                          throws Exception
Creates a new sibling of a resource.

Parameters:
tc - the OpenCms test case
cms - the current user's Cms object
source - path/resource name of the existing resource
target - path/resource name of the new sibling
Throws:
Exception - if something goes wrong

suite

public static junit.framework.Test suite()
Test suite for this test class.

Returns:
the test suite

testDeleteAllSiblings

public void testDeleteAllSiblings()
                           throws Throwable
Tests deletion of a resource together with all siblings.

Throws:
Throwable - if something goes wrong

testSiblingIssueAfterImport

public void testSiblingIssueAfterImport()
                                 throws Exception
Error scenario where an import is deleted that contains siblings inside the same folders.

Throws:
Exception - if something goes wrong

testSiblingProjects

public void testSiblingProjects()
                         throws Throwable
Tests the "project last modified" state with sibling operations across different projects.

Throws:
Throwable - if something goes wrong

testSiblingsCopy

public void testSiblingsCopy()
                      throws Throwable
Tests the "copy as new sibling" function.

Throws:
Throwable - if something goes wrong

testSiblingsCreate

public void testSiblingsCreate()
                        throws Throwable
Tests the "copy as new sibling" function.

Throws:
Throwable - if something goes wrong

testSiblingsCreateIssue

public void testSiblingsCreateIssue()
                             throws Throwable
Tests creating 2 new siblings and publishing just one of them.

Throws:
Throwable - if something goes wrong

testSiblingsNewDeletePublishIssue

public void testSiblingsNewDeletePublishIssue()
                                       throws Exception
Tests an issue, where there is an error in OpenCms V7 when publishing two siblings of the same resource. One sibling is new created, the other one is a deleted one. In OpenCms V8 this scenario should give no error.

Throws:
Exception - if the test fails

testSiblingsRelations

public void testSiblingsRelations()
                           throws Throwable
Tests the link management features with siblings.

Throws:
Throwable - if something goes wrong

testSiblingStateIssue

public void testSiblingStateIssue()
                           throws Throwable
Tests if setting the flags of a sibling will do any modifications to other siblings.

Throws:
Throwable - if something goes wrong

testSiblingsV7PublishIssue

public void testSiblingsV7PublishIssue()
                                throws Exception
Tests an issue present in OpenCms 7 where online content was not replaced after publish.

Throws:
Exception - if the test fails