com.ptc.windchill.uwgm.common.container
Class ContainerUtilitiesTest

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.container.ContainerUtilitiesTest
All Implemented Interfaces:
junit.framework.Test, com.ptc.windchill.uwgm.test.util.UwgmTestConstants

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

Test class for ContainerUtilities based on JUnit framework. Currently contains the following tests: 1) testContainerUtilities(): Create a test workspace for a user (uwgmuser1) Create a WTPart and add it to the workspoace created Test the following APIs from ContainerUtilities: getContainersByName getPDMLinkContainers getContainerForPersistable getRegisteredContainers isActive The workspace and WTPart created in the setUp(),is deleted tearDown() methods respectively.


Nested Class Summary
 
Nested classes inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
 
Field Summary
private  String administratorName
           
private  WTPrincipal principal
           
private  WTPart[] testParts
           
private  WTContainer testProduct
           
private  WTPrincipal user1
           
private  WTPrincipal user2
           
private static String UWGM_TEST_PART_NAME
           
private static String UWGM_TEST_PRODUCT_NAME
           
private static String UWGM_TEST_PRODUCT2_NAME
           
private static String UWGM_TEST_WORKSPACE_NAME
           
private  EPMWorkspace ws
           
 
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
ContainerUtilitiesTest()
           
ContainerUtilitiesTest(String methodName)
           
 
Method Summary
private  void addTestPartsToWorkspace()
           
private  void CheckActiveContainers()
          Internal method to check if a Container is Active or not return void
private  void CheckRegisteredContainers()
          Internal method to check getRegisteredContainers API
private  void createTestParts()
           
private  void createTestWorkspace()
           
private  void deleteTestParts()
           
private  void deleteTestWorkspace()
           
private  void findTestProduct()
           
private  boolean isContainerFound(WTContainer[] containers)
           
static void main(String[] args)
           
private  void removeTestPartsFromWorkspace()
           
protected  void setUp()
           
static junit.framework.Test suite()
           
protected  void tearDown()
           
 void testContainerUtilities()
           
 
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

UWGM_TEST_WORKSPACE_NAME

private static final String UWGM_TEST_WORKSPACE_NAME
See Also:
Constant Field Values

UWGM_TEST_PRODUCT_NAME

private static final String UWGM_TEST_PRODUCT_NAME
See Also:
Constant Field Values

UWGM_TEST_PRODUCT2_NAME

private static final String UWGM_TEST_PRODUCT2_NAME
See Also:
Constant Field Values

UWGM_TEST_PART_NAME

private static final String UWGM_TEST_PART_NAME
See Also:
Constant Field Values

ws

private EPMWorkspace ws

testProduct

private WTContainer testProduct

principal

private WTPrincipal principal

testParts

private WTPart[] testParts

user1

private WTPrincipal user1

user2

private WTPrincipal user2

administratorName

private String administratorName
Constructor Detail

ContainerUtilitiesTest

public ContainerUtilitiesTest()

ContainerUtilitiesTest

public ContainerUtilitiesTest(String methodName)
Method Detail

setUp

protected void setUp()

testContainerUtilities

public void testContainerUtilities()

tearDown

protected void tearDown()

CheckActiveContainers

private void CheckActiveContainers()
                            throws WTException
Internal method to check if a Container is Active or not return void

Throws:
WTException

CheckRegisteredContainers

private void CheckRegisteredContainers()
                                throws WTException
Internal method to check getRegisteredContainers API

Throws:
WTException

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)

findTestProduct

private void findTestProduct()
                      throws WTException,
                             WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

createTestWorkspace

private void createTestWorkspace()
                          throws WTException,
                                 WTPropertyVetoException,
                                 Exception
Throws:
WTException
WTPropertyVetoException
Exception

deleteTestWorkspace

private void deleteTestWorkspace()
                          throws WTException
Throws:
WTException

createTestParts

private void createTestParts()
                      throws WTException,
                             WTPropertyVetoException,
                             Exception
Throws:
WTException
WTPropertyVetoException
Exception

addTestPartsToWorkspace

private void addTestPartsToWorkspace()
                              throws WTException
Throws:
WTException

removeTestPartsFromWorkspace

private void removeTestPartsFromWorkspace()
                                   throws WTException
Throws:
WTException

deleteTestParts

private void deleteTestParts()
                      throws WTException
Throws:
WTException

isContainerFound

private boolean isContainerFound(WTContainer[] containers)