org.alfresco.repo.content.filestore
Class FileContentStoreTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.alfresco.repo.content.AbstractReadOnlyContentStoreTest
              extended by org.alfresco.repo.content.AbstractWritableContentStoreTest
                  extended by org.alfresco.repo.content.filestore.FileContentStoreTest
All Implemented Interfaces:
junit.framework.Test

public class FileContentStoreTest
extends AbstractWritableContentStoreTest

Tests read and write functionality for the store.

See Also:
FileContentStore

Field Summary
 
Fields inherited from class org.alfresco.repo.content.AbstractReadOnlyContentStoreTest
ctx, transactionService
 
Constructor Summary
FileContentStoreTest()
           
 
Method Summary
protected  ContentStore getStore()
          Fetch the store to be used during a test.
 void setUp()
          Starts a transaction
 void testConcurrentWriteDetection()
          Checks that the store disallows concurrent writers to be issued to the same URL.
 void testDeleteLeavesNonEmptyDirs()
          Only non-empty directories should be deleted.
 void testDeleteRemovesEmptyDirs()
          Empty parent directories should be removed when a URL is removed.
 void testNoParentDirsDeleted()
          Empty parent directories are not deleted if the store is configured not to.
 void testRootLocation()
          Just check that the method doesn't blow up
 void testSpaceFree()
          Ensures that the size is something other than -1 or Long.MAX_VALUE
 void testSpaceTotal()
          Ensures that the size is something other than -1 or Long.MAX_VALUE
 void testSpaceUsed()
          Ensures that the size is positive
 
Methods inherited from class org.alfresco.repo.content.AbstractWritableContentStoreTest
getExistingContentUrl, getWriter, testClosedState, testDeleteReaderStates, testDeleteSimple, testGetReader, testGetUrls, testIllegalWritableContentUrls, testListUrls, testMimetypAndEncodingAndLocale, testRandomAccessRead, testRandomAccessWrite, testReadAndWriteFile, testReadAndWriteStreamByPull, testReadAndWriteStreamByPush, testReaderImmutability, testSetUp, testSimpleUse, testStringTruncation, testWritable, testWriteAndReadString, testWriteStreamListener
 
Methods inherited from class org.alfresco.repo.content.AbstractReadOnlyContentStoreTest
getReader, tearDown, testBlockedWriteOperations, testGetReaderForExistingContentUrl, testIllegalReadableContentUrls
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileContentStoreTest

public FileContentStoreTest()
Method Detail

setUp

public void setUp()
           throws java.lang.Exception
Description copied from class: AbstractReadOnlyContentStoreTest
Starts a transaction

Overrides:
setUp in class AbstractReadOnlyContentStoreTest
Throws:
java.lang.Exception

getStore

protected ContentStore getStore()
Description copied from class: AbstractReadOnlyContentStoreTest
Fetch the store to be used during a test. This method is invoked once per test - it is therefore safe to use setUp to initialise resources.

Usually tests will construct a static instance of the store to use throughout all the tests.

Specified by:
getStore in class AbstractReadOnlyContentStoreTest
Returns:
Returns the same instance of a store for all invocations.

testConcurrentWriteDetection

public void testConcurrentWriteDetection()
                                  throws java.lang.Exception
Checks that the store disallows concurrent writers to be issued to the same URL.

Throws:
java.lang.Exception

testRootLocation

public void testRootLocation()
                      throws java.lang.Exception
Description copied from class: AbstractWritableContentStoreTest
Just check that the method doesn't blow up

Overrides:
testRootLocation in class AbstractWritableContentStoreTest
Throws:
java.lang.Exception

testSpaceUsed

public void testSpaceUsed()
                   throws java.lang.Exception
Ensures that the size is positive

Overrides:
testSpaceUsed in class AbstractWritableContentStoreTest
Throws:
java.lang.Exception

testSpaceFree

public void testSpaceFree()
                   throws java.lang.Exception
Ensures that the size is something other than -1 or Long.MAX_VALUE

Overrides:
testSpaceFree in class AbstractWritableContentStoreTest
Throws:
java.lang.Exception

testSpaceTotal

public void testSpaceTotal()
                    throws java.lang.Exception
Ensures that the size is something other than -1 or Long.MAX_VALUE

Overrides:
testSpaceTotal in class AbstractWritableContentStoreTest
Throws:
java.lang.Exception

testDeleteRemovesEmptyDirs

public void testDeleteRemovesEmptyDirs()
                                throws java.lang.Exception
Empty parent directories should be removed when a URL is removed.

Throws:
java.lang.Exception

testDeleteLeavesNonEmptyDirs

public void testDeleteLeavesNonEmptyDirs()
Only non-empty directories should be deleted.


testNoParentDirsDeleted

public void testNoParentDirsDeleted()
                             throws java.lang.Exception
Empty parent directories are not deleted if the store is configured not to.

Throws:
java.lang.Exception


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.