com.ptc.windchill.uwgm.common.pdm
Class PartDocumentRetrieverTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
com.ptc.windchill.uwgm.common.pdm.PartDocumentRetrieverTest
- All Implemented Interfaces:
- junit.framework.Test, com.ptc.windchill.uwgm.test.util.UwgmTestConstants
- public class PartDocumentRetrieverTest
- extends com.ptc.windchill.uwgm.test.util.AbstractUwgmTest
This class tests the methods from PartDocumentRetriever. As in case of WorkspaceContentTest
from package com.ptc.windchill.uwgm.common.workspace, this class also creates a workspace
and a few documents and parts using WorkspaceDataLoader. It then uses the cached PartDocumentRetriever
instance to test whether correct objects are retrieved based upon appropriate specs. Note
that currently only retrieval based on Object IDs is working since other specs are not
yet supported in WorkspaceContent. This test should be updated to include support for
master ID, number and CAD name specs once that is available. Finally as in case of
WorkspaceContentTest, all the objects are destroyed in tearDown().
This class provides an implementation of RetrieverSpec which is exactly the same as the
one in RetrieverSpecHelper.java. Instances of the implemented class are used to create
lists of retriever specs for parts and documents.
Again, as in case of WorkspaceContentTest.java, a default implementation of suite() method
has been provided to run the tests in this class as a suite or within another suite.
Nested classes inherited from class com.ptc.windchill.uwgm.test.util.AbstractUwgmTest |
|
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 |
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 |
workspace
private EPMWorkspace workspace
wsDataLoader
private com.ptc.windchill.uwgm.test.fixture.WorkspaceDataLoader wsDataLoader
testProduct
private WTContainer testProduct
testParts
private WTPart[] testParts
testDocs
private EPMDocument[] testDocs
principal
private WTPrincipal principal
retriever
private PartDocumentRetriever retriever
PartDocumentRetrieverTest
public PartDocumentRetrieverTest()
PartDocumentRetrieverTest
public PartDocumentRetrieverTest(String methodName)
setUp
protected void setUp()
testObjectRetrieval
public void testObjectRetrieval()
tearDown
protected void tearDown()
suite
public static junit.framework.Test suite()
main
public static void main(String[] args)
getRetrieverSpecs
private Collection getRetrieverSpecs(RetrieverSpec.Type specType,
Persistable[] objects)
throws WTException
- Throws:
WTException
compare
private void compare(WTPart[] parts1,
WTPart[] parts2,
boolean isCheckedIn)
compare
private void compare(EPMDocument[] docs1,
EPMDocument[] docs2,
boolean isCheckedIn)
retrieveObjects
private void retrieveObjects(boolean isCheckedIn)
throws WTException
- Throws:
WTException
retrieveParts
private void retrieveParts(RetrieverSpec.Type[] partSpecTypes,
boolean isCheckedIn)
throws WTException
- Throws:
WTException
retrieveDocuments
private void retrieveDocuments(RetrieverSpec.Type[] docSpecTypes,
boolean isCheckedIn)
throws WTException
- Throws:
WTException