com.ptc.windchill.uwgm.proesrv.request
Class EpmRenameRequestTest

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.request.AbstractUwgmRequestTest
                  extended bycom.ptc.windchill.uwgm.proesrv.request.EpmRenameRequestTest
All Implemented Interfaces:
junit.framework.Test, com.ptc.windchill.uwgm.test.util.UwgmTestConstants

public class EpmRenameRequestTest
extends AbstractUwgmRequestTest

Test class for testing EpmRenameRequest. It currently performs the following tests : - testEpmRenameRequest(): Creates 7 standalone documents, rename/renumbers 3 documents and changes the CAD names of 4 documents by creating and invoking an EpmRename request and then verifies that the documents were renamed/renumbered successfully. - testEpmAssemblyRename(): Similar to the above test except for the fact that here instead of standalone documents, an assembly with a parent and six children is created. - testEpmFamilyRename(): Same as above except that instead of an assembly, a family table containing six instances is created.


Nested Class Summary
private  class EpmRenameRequestTest.EpmRenameData
          Helper class to hold the new values of the EPMDocumentMaster attributes to be passed to the EpmRename request.
 
Nested classes inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
 
Field Summary
private static String CAD_NAME_CHANGE_SUFFIX
           
private static List cadNameChangeIndices
           
private static Log log
           
private  WTKeyedMap masterToEpmRenameData
           
private static List nameChangeIndices
           
private static List numberChangeIndices
           
private static String RENAME_SUFFIX
           
private static int RENAME_TEST_DOC_NOS
           
private static String RENUMBER_SUFFIX
           
private  com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader
           
 
Fields inherited from class com.ptc.windchill.uwgm.proesrv.request.AbstractUwgmRequestTest
oidHelper, principal, testProduct, testProject
 
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
EpmRenameRequestTest()
           
EpmRenameRequestTest(String methodName)
           
 
Method Summary
private  EpmRenameRequestTest.EpmRenameData[] createEpmRenameData(EPMDocument[] testDocs)
           
private  com.ptc.windchill.uwgm.soap.uwgmsvc.EpmRenameInstruction createEpmRenameInstruction(EpmRenameRequestTest.EpmRenameData epmRenameData, EPMDocument doc)
           
private  com.ptc.windchill.uwgm.soap.uwgmsvc.EpmRenameInstruction.Iterator createEpmRenameInstructions(EPMDocument[] testDocs, EpmRenameRequestTest.EpmRenameData[] epmRenameData)
           
protected  com.ptc.windchill.uwgm.soap.uwgm.Request[] createRequests()
           
private  WTCollection getEPMDocumentMasters(EPMDocument[] testDocs)
           
private  String getNewValue(String oldValue, String suffix)
           
static void main(String[] args)
           
protected  void printRequest(com.ptc.windchill.uwgm.soap.uwgm.UwgmRequest uwgmRequest, int cnt)
           
private  void refreshTestDocs(EPMDocument[] testDocs)
           
static junit.framework.Test suite()
           
 void testEpmAssemblyRename()
           
 void testEpmFamilyRename()
           
 void testEpmRenameRequest()
           
private  void validateCreatedData(String methodName)
           
private  void verifyEpmMaster(com.ptc.windchill.uwgm.soap.uwgmdb.EpmMaster epmMaster, WTCollection wtMasters)
           
protected  void verifySuccessMessage(com.ptc.windchill.uwgm.soap.uwgm.Message msg)
           
 
Methods inherited from class com.ptc.windchill.uwgm.proesrv.request.AbstractUwgmRequestTest
createUwgmIterations, createUwgmIterations, createUwgmIterations, createUwgmWorkspace, createUwgmWorkspace, createUwgmWorkspace, getWorkspaceObjects, getWorkspaceObjectsMap, performUwgmRequestTest, printIterations, printWorkspace, setUp, verifyResponseMessages, verifyTransactionMessages
 
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

wsDataLoader

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

masterToEpmRenameData

private WTKeyedMap masterToEpmRenameData

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 List cadNameChangeIndices

nameChangeIndices

private static final List nameChangeIndices

numberChangeIndices

private static final List numberChangeIndices

RENAME_SUFFIX

private static final String RENAME_SUFFIX
See Also:
Constant Field Values

RENUMBER_SUFFIX

private static final String RENUMBER_SUFFIX
See Also:
Constant Field Values

CAD_NAME_CHANGE_SUFFIX

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

EpmRenameRequestTest

public EpmRenameRequestTest()

EpmRenameRequestTest

public EpmRenameRequestTest(String methodName)
Method Detail

testEpmRenameRequest

public void testEpmRenameRequest()
                          throws Throwable
Throws:
Throwable

testEpmAssemblyRename

public void testEpmAssemblyRename()
                           throws Throwable
Throws:
Throwable

testEpmFamilyRename

public void testEpmFamilyRename()
                         throws Throwable
Throws:
Throwable

createRequests

protected com.ptc.windchill.uwgm.soap.uwgm.Request[] createRequests()
                                                             throws com.ptc.cipjava.jxthrowable,
                                                                    WTException
Specified by:
createRequests in class AbstractUwgmRequestTest
Throws:
com.ptc.cipjava.jxthrowable
WTException

printRequest

protected void printRequest(com.ptc.windchill.uwgm.soap.uwgm.UwgmRequest uwgmRequest,
                            int cnt)
Overrides:
printRequest in class AbstractUwgmRequestTest

verifySuccessMessage

protected void verifySuccessMessage(com.ptc.windchill.uwgm.soap.uwgm.Message msg)
                             throws WTException
Overrides:
verifySuccessMessage in class AbstractUwgmRequestTest
Throws:
WTException

validateCreatedData

private void validateCreatedData(String methodName)

createEpmRenameInstructions

private com.ptc.windchill.uwgm.soap.uwgmsvc.EpmRenameInstruction.Iterator createEpmRenameInstructions(EPMDocument[] testDocs,
                                                                                                      EpmRenameRequestTest.EpmRenameData[] epmRenameData)
                                                                                               throws WTException
Throws:
WTException

createEpmRenameInstruction

private com.ptc.windchill.uwgm.soap.uwgmsvc.EpmRenameInstruction createEpmRenameInstruction(EpmRenameRequestTest.EpmRenameData epmRenameData,
                                                                                            EPMDocument doc)
                                                                                     throws WTException
Throws:
WTException

refreshTestDocs

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

verifyEpmMaster

private void verifyEpmMaster(com.ptc.windchill.uwgm.soap.uwgmdb.EpmMaster epmMaster,
                             WTCollection wtMasters)
                      throws WTException
Throws:
WTException

getEPMDocumentMasters

private WTCollection getEPMDocumentMasters(EPMDocument[] testDocs)

getNewValue

private String getNewValue(String oldValue,
                           String suffix)

createEpmRenameData

private EpmRenameRequestTest.EpmRenameData[] createEpmRenameData(EPMDocument[] testDocs)

suite

public static junit.framework.Test suite()

main

public static void main(String[] args)