com.ptc.windchill.uwgm.common.folder
Class FolderContentTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.ptc.windchill.uwgm.test.util.AbstractUwgmTest
              extended bycom.ptc.windchill.uwgm.common.folder.FolderContentTest
All Implemented Interfaces:
junit.framework.Test, com.ptc.windchill.uwgm.test.util.UwgmTestConstants

public class FolderContentTest
extends com.ptc.windchill.uwgm.test.util.AbstractUwgmTest

Test class for testing the APIs from FolderContent from the same package. It uses WorkspaceDataLoader to create a workspace and populate it with some parts and documents. Then it creates a folder and moves the objects to that folder. The following tests are performed: 1) testSubFolders(): Checks if the getSubFolders() API works and specifically if it returns the folder created above under the default folder location for the container 2) testFolderContent(): Checks if the getIterations() API from FolderContent works by comparing the fixture objects with the ones returned by this API. 3) testGetAllIterations(): Creates a few iterations of parts and documents by repeatedly checking them out and in. Then tests the getAllIterations() API of FolderContent to see if all the created iterations are correctly returned by this API for each object.


Nested Class Summary
 
Nested classes inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
 
Field Summary
private static int NUMBER_OF_ITERATIONS_CREATED
           
private  EPMDocument[] testDocs
           
private  Folder testFolder
           
private  Folder testFolderLocation
           
private  WTPart[] testParts
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader
           
 
Fields inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
 
Fields inherited from class junit.framework.TestCase
 
Fields inherited from interface com.ptc.windchill.uwgm.test.util.UwgmTestConstants
UWGM_CLIENT_CACHE_ID, UWGM_CLIENT_NAME, UWGM_CLIENT_VERSION, UWGM_TEST_ASSEMBLY_CHILDREN_NOS, UWGM_TEST_BOOLEAN, UWGM_TEST_DEFAULT_FOLDER_PATH, UWGM_TEST_DEFAULT_LIFECYCLE_NAME, UWGM_TEST_DEFAULT_LIFECYCLE_PROP_NAME, UWGM_TEST_DEFAULT_TEAMTEMPLATE_NAME, UWGM_TEST_DOC_NAME_PREFIX, UWGM_TEST_DOC_NOS, UWGM_TEST_FAMILY_INSTANCE_NOS, UWGM_TEST_FLOAT, UWGM_TEST_FOLDER_NAME_PREFIX, UWGM_TEST_GENERIC_NAME_PREFIX, UWGM_TEST_INSTANCE_NAME_PREFIX, UWGM_TEST_INTEGER, UWGM_TEST_PART_NAME_PREFIX, UWGM_TEST_PART_NOS, UWGM_TEST_PRODUCT1_NAME, UWGM_TEST_PROJECT1_NAME, UWGM_TEST_STRING, UWGM_TEST_WORKSPACE_NAME_PREFIX
 
Constructor Summary
FolderContentTest()
           
FolderContentTest(String methodName)
           
 
Method Summary
private  boolean checkAllIterations(WTCollection iterationCollection, RevisionControlled object, Map oidToItersMap)
           
private  void checkDocIterationsInFolder(FolderContent folderContent, Map oidToItersMap)
           
private  void checkDocsInFolderContent(FolderContent folderContent)
           
private  boolean checkFolderContents(Folder[] folders)
           
private  void checkPartIterationsInFolder(FolderContent folderContent, Map oidToItersMap)
           
private  void checkPartsInFolderContent(FolderContent folderContent)
           
static void main(String[] args)
           
private  void performSetUpChecks()
           
private  boolean search(Iterated object, Iterated[] iterations)
           
protected  void setUp()
           
static junit.framework.Test suite()
           
protected  void tearDown()
           
 void testFolderContent()
           
 void testGetAllIterations()
           
 void testSubFolders()
           
private  void updateOidToItersMap(Map oidToItersMap)
           
private  void updateOidToItersMap(RevisionControlled[] objects, Map oidToItersMap)
           
 
Methods inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
getTestResult, reportError, reportFailure, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

testParts

private WTPart[] testParts

testDocs

private EPMDocument[] testDocs

testFolder

private Folder testFolder

testFolderLocation

private Folder testFolderLocation

wsDataLoader

private com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader

NUMBER_OF_ITERATIONS_CREATED

private static final int NUMBER_OF_ITERATIONS_CREATED
See Also:
Constant Field Values
Constructor Detail

FolderContentTest

public FolderContentTest()

FolderContentTest

public FolderContentTest(String methodName)
Method Detail

setUp

protected void setUp()

testSubFolders

public void testSubFolders()

testFolderContent

public void testFolderContent()

testGetAllIterations

public void testGetAllIterations()

tearDown

protected void tearDown()

performSetUpChecks

private void performSetUpChecks()

checkFolderContents

private boolean checkFolderContents(Folder[] folders)

checkPartsInFolderContent

private void checkPartsInFolderContent(FolderContent folderContent)
                                throws WTException
Throws:
WTException

checkDocsInFolderContent

private void checkDocsInFolderContent(FolderContent folderContent)
                               throws WTException
Throws:
WTException

search

private boolean search(Iterated object,
                       Iterated[] iterations)

updateOidToItersMap

private void updateOidToItersMap(Map oidToItersMap)

updateOidToItersMap

private void updateOidToItersMap(RevisionControlled[] objects,
                                 Map oidToItersMap)

checkPartIterationsInFolder

private void checkPartIterationsInFolder(FolderContent folderContent,
                                         Map oidToItersMap)
                                  throws WTException
Throws:
WTException

checkDocIterationsInFolder

private void checkDocIterationsInFolder(FolderContent folderContent,
                                        Map oidToItersMap)
                                 throws WTException
Throws:
WTException

checkAllIterations

private boolean checkAllIterations(WTCollection iterationCollection,
                                   RevisionControlled object,
                                   Map oidToItersMap)

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)