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

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

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

Test class for testing EpmRenameAction. - setUp() sets up the fixtures for the test viz. the container and the principal - testEpmRenameAction() creates some standalone documents, changes their names and/or numbers and/or CAD names and verifies that all the changes have been done correctly. - testEpmRenameAssembly() is same as above except that it creates an assembly of of documents instead of standalone ones. - testEpmRenameFamily() does the same as above except that it creates a family of documents instead of an assembly.


Nested Class Summary
 
Nested classes inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
 
Field Summary
private static int[] cadNameChangeIndices
           
private static Log log
           
private static int[] nameChangeIndices
           
private static int[] nameNumberChangeIndices
           
private static int[] numberChangeIndices
           
private  WTPrincipal principal
           
private static String RENAME_SUFFIX
           
private static int RENAME_TEST_DOC_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
EpmRenameActionTest()
           
EpmRenameActionTest(String methodName)
           
 
Method Summary
private  void checkNewCadNames(String[] newCadNames, EPMDocument[] testDocs)
           
private  void checkNewIdentities(RenameInfo[] renameInfos, EPMDocument[] testDocs)
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createAssemblies()
           
private  WTKeyedMap createCadNameMap(String[] newCadNames, EPMDocument[] testDocs)
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createFamilies()
           
private  WTKeyedMap createIdentityInfoMap(RenameInfo[] renameInfos, EPMDocument[] testDocs)
           
private  String[] createNewCadNames(EPMDocument[] testDocs)
           
private  RenameInfo[] createRenameInfos(EPMDocument[] testDocs)
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader createStandaloneDocuments()
           
private  String getNewValue(String oldValue)
           
static void main(String[] args)
           
private  void performEpmRenameTest(com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader, String methodName, boolean canDeleteData)
           
private  void refreshTestDocs(EPMDocument[] testDocs)
           
protected  void setUp()
           
static junit.framework.Test suite()
           
 void testEpmRenameAction()
           
 void testEpmRenameAssembly()
           
 void testEpmRenameFamily()
           
 
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 Log log

RENAME_TEST_DOC_NOS

private static final int RENAME_TEST_DOC_NOS
See Also:
Constant Field Values

cadNameChangeIndices

private static final int[] cadNameChangeIndices

nameChangeIndices

private static final int[] nameChangeIndices

numberChangeIndices

private static final int[] numberChangeIndices

nameNumberChangeIndices

private static final int[] nameNumberChangeIndices

RENAME_SUFFIX

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

EpmRenameActionTest

public EpmRenameActionTest()

EpmRenameActionTest

public EpmRenameActionTest(String methodName)
Method Detail

setUp

protected void setUp()
              throws Exception
Throws:
Exception

testEpmRenameAction

public void testEpmRenameAction()
                         throws Throwable
Throws:
Throwable

testEpmRenameAssembly

public void testEpmRenameAssembly()
                           throws Throwable
Throws:
Throwable

testEpmRenameFamily

public void testEpmRenameFamily()
                         throws Throwable
Throws:
Throwable

createStandaloneDocuments

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

createAssemblies

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

createFamilies

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

performEpmRenameTest

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

createNewCadNames

private String[] createNewCadNames(EPMDocument[] testDocs)

createRenameInfos

private RenameInfo[] createRenameInfos(EPMDocument[] testDocs)

createCadNameMap

private WTKeyedMap createCadNameMap(String[] newCadNames,
                                    EPMDocument[] testDocs)

createIdentityInfoMap

private WTKeyedMap createIdentityInfoMap(RenameInfo[] renameInfos,
                                         EPMDocument[] testDocs)

refreshTestDocs

private void refreshTestDocs(EPMDocument[] testDocs)
                      throws WTException
Throws:
WTException

checkNewCadNames

private void checkNewCadNames(String[] newCadNames,
                              EPMDocument[] testDocs)

checkNewIdentities

private void checkNewIdentities(RenameInfo[] renameInfos,
                                EPMDocument[] testDocs)

getNewValue

private String getNewValue(String oldValue)

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)