org.opencms.file
Class TestReadResource

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

public class TestReadResource
extends OpenCmsTestCase

Unit test for the "readFileHeader" method of the CmsObject to test the release and expiration date.


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
TestReadResource(String arg0)
          Default JUnit constructor.
 
Method Summary
static void readAfterExpirationDate(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsResourceFilter filter)
          Test readResource of a file after its expirationrelease date.
static void readBeforeReleaseDate(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsResourceFilter filter)
          Test readResource of a file before its release date.
static void readInValidTimeRange(OpenCmsTestCase tc, CmsObject cms, String resource1, CmsResourceFilter filter)
          Test readResource of a file in its valid time range.
static junit.framework.Test suite()
          Test suite for this test class.
 void testReadAfterExpirationDate()
          Test readFileHeader of a file after its expiration date.
 void testReadAfterExpirationDateIgnore()
          Test readFileHeader of a file after its expiration date.
 void testReadBeforeReleaseDate()
          Test readResource of a file before its release date.
 void testReadBeforeReleaseDateIgnore()
          Test readFileHeader of a file before its release date.
 void testReadFileWithResourceID()
          Test readFile with the structure id.
 void testReadInValidTimeRange()
          Test readFileHeader of a file in its valid time range.
 void testReadInValidTimeRangeIgnore()
          Test readFileHeader of a file in its valid time range.
 void testReadWithResourceID()
          Test readResource methods that use the structureId.
 void testReadWithWrongResourceID()
          Test readResource whether an incorrect structureID throws an exception.
 
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

TestReadResource

public TestReadResource(String arg0)
Default JUnit constructor.

Parameters:
arg0 - JUnit parameters
Method Detail

suite

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

Returns:
the test suite

readBeforeReleaseDate

public static void readBeforeReleaseDate(OpenCmsTestCase tc,
                                         CmsObject cms,
                                         String resource1,
                                         CmsResourceFilter filter)
                                  throws Throwable
Test readResource of a file before its release date.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to touch
filter - the filter to use
Throws:
Throwable - if something goes wrong

readAfterExpirationDate

public static void readAfterExpirationDate(OpenCmsTestCase tc,
                                           CmsObject cms,
                                           String resource1,
                                           CmsResourceFilter filter)
                                    throws Throwable
Test readResource of a file after its expirationrelease date.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to touch
filter - the filter to use
Throws:
Throwable - if something goes wrong

readInValidTimeRange

public static void readInValidTimeRange(OpenCmsTestCase tc,
                                        CmsObject cms,
                                        String resource1,
                                        CmsResourceFilter filter)
                                 throws Throwable
Test readResource of a file in its valid time range.

Parameters:
tc - the OpenCmsTestCase
cms - the CmsObject
resource1 - the resource to touch
filter - the filter to use
Throws:
Throwable - if something goes wrong

testReadBeforeReleaseDate

public void testReadBeforeReleaseDate()
                               throws Throwable
Test readResource of a file before its release date.

Throws:
Throwable - if something goes wrong

testReadAfterExpirationDate

public void testReadAfterExpirationDate()
                                 throws Throwable
Test readFileHeader of a file after its expiration date.

Throws:
Throwable - if something goes wrong

testReadInValidTimeRange

public void testReadInValidTimeRange()
                              throws Throwable
Test readFileHeader of a file in its valid time range.

Throws:
Throwable - if something goes wrong

testReadBeforeReleaseDateIgnore

public void testReadBeforeReleaseDateIgnore()
                                     throws Throwable
Test readFileHeader of a file before its release date.

The valid time range will be ignored.

Throws:
Throwable - if something goes wrong

testReadAfterExpirationDateIgnore

public void testReadAfterExpirationDateIgnore()
                                       throws Throwable
Test readFileHeader of a file after its expiration date.

The valid time range will be ignored.

Throws:
Throwable - if something goes wrong

testReadInValidTimeRangeIgnore

public void testReadInValidTimeRangeIgnore()
                                    throws Throwable
Test readFileHeader of a file in its valid time range.

The valid time range will be ignored.

Throws:
Throwable - if something goes wrong

testReadWithResourceID

public void testReadWithResourceID()
                            throws Throwable
Test readResource methods that use the structureId.

Throws:
Throwable - if something goes wrong

testReadWithWrongResourceID

public void testReadWithWrongResourceID()
                                 throws Throwable
Test readResource whether an incorrect structureID throws an exception.

Throws:
Throwable - if something goes wrong

testReadFileWithResourceID

public void testReadFileWithResourceID()
                                throws Throwable
Test readFile with the structure id.

Throws:
Throwable - if something is wrong