com.ptc.windchill.uwgm.proesrv.action
Class PartRenameActionTest

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

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

Test class for testing PartRenameAction. The setUp() method sets up the fixtures for the class while the following tests are performed: - testPartRenameAction(): Creates 3 standalone WTParts, renames 2 and renumbers 2 of them and finally verifies if the parts have been renamed/renumbered successfully. - testPartRenameAssembly(): Same as above except that it creates an assembly of parts with one parent and two children.


Nested Class Summary
 
Nested classes inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
 
Field Summary
private static Log log
           
private  WTPrincipal principal
           
private static String RENAME_SUFFIX
           
private static int RENAME_TEST_PART_NOS
           
private  WTContainer testProduct
           
 
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
PartRenameActionTest()
           
PartRenameActionTest(String methodName)
           
 
Method Summary
private  void checkNewIdentities(RenameInfo[] renameInfos, WTPart[] testParts)
           
private  WTKeyedMap createIdentityInfoMap(RenameInfo[] renameInfos, WTPart[] testParts)
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createPartAssemblies()
           
private  RenameInfo[] createRenameInfos(WTPart[] testParts)
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createStandaloneParts()
           
private  String getNewValue(String oldValue)
           
static void main(String[] args)
           
private  void performPartRenameTest(com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader, String methodName)
           
private  void refreshTestParts(WTPart[] testParts)
           
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testPartRenameAction()
           
 void testPartRenameAssembly()
           
 
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, 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
 

Field Detail

principal

private WTPrincipal principal

testProduct

private WTContainer testProduct

log

private static final Log log

RENAME_TEST_PART_NOS

private static final int RENAME_TEST_PART_NOS
See Also:
Constant Field Values

RENAME_SUFFIX

private static final String RENAME_SUFFIX
See Also:
Constant Field Values
Constructor Detail

PartRenameActionTest

public PartRenameActionTest()

PartRenameActionTest

public PartRenameActionTest(String methodName)
Method Detail

setUp

protected void setUp()
              throws Exception
Throws:
Exception

testPartRenameAction

public void testPartRenameAction()
                          throws Throwable
Throws:
Throwable

testPartRenameAssembly

public void testPartRenameAssembly()
                            throws Throwable
Throws:
Throwable

createStandaloneParts

private com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createStandaloneParts()
                                                                               throws Exception
Throws:
Exception

createPartAssemblies

private com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createPartAssemblies()
                                                                              throws Exception
Throws:
Exception

performPartRenameTest

private void performPartRenameTest(com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader,
                                   String methodName)
                            throws Throwable
Throws:
Throwable

createRenameInfos

private RenameInfo[] createRenameInfos(WTPart[] testParts)

createIdentityInfoMap

private WTKeyedMap createIdentityInfoMap(RenameInfo[] renameInfos,
                                         WTPart[] testParts)

refreshTestParts

private void refreshTestParts(WTPart[] testParts)
                       throws WTException
Throws:
WTException

checkNewIdentities

private void checkNewIdentities(RenameInfo[] renameInfos,
                                WTPart[] testParts)

getNewValue

private String getNewValue(String oldValue)

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)