wt.step.processor
Class ImportTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bywt.step.STEPTestCase
              extended bywt.step.processor.ImportTestHarness
                  extended bywt.step.processor.ImportTest
All Implemented Interfaces:
junit.framework.Test

public class ImportTest
extends ImportTestHarness

Tests of import functionality. Builds its own test data and erases existing UnitTest parts as necessary.


Nested Class Summary
(package private)  class ImportTest.MockImportProcessor
          The real ImportProcessor attempts to upload data files.
 
Nested classes inherited from class wt.step.processor.ImportTestHarness
ImportTestHarness.AppData, ImportTestHarness.Doc, ImportTestHarness.DocMaster, ImportTestHarness.Entity, ImportTestHarness.Part, ImportTestHarness.PartDescribeLink, ImportTestHarness.PartMaster, ImportTestHarness.PartUsageLink, ImportTestHarness.StepFileContent
 
Field Summary
private static ImportFromP21Processor _importProcessor
           
private static ExpressSchema _wtSchema
           
private static String TEST_BASELINE_DESCRIPTION
           
private static String TEST_BASELINE_NAME
           
private static String TEST_CONTENT_NAME
           
private static String TEST_DOC_MASTER_NAME
           
private static String TEST_DOC_MASTER_NUMBER
           
private static String TEST_PART_MASTER_NAME
           
private static String TEST_PART_MASTER_NUMBER
           
private static String TEST_SUBPART_MASTER_NAME
           
private static String TEST_SUBPART_MASTER_NUMBER
           
 
Fields inherited from class wt.step.processor.ImportTestHarness
TEST_FILE_SIZE
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
ImportTest(String name)
           
 
Method Summary
private  void doImport(ImportTestHarness.StepFileContent data, ImportScheme versionsScheme)
           
private  void doImport(ImportTestHarness.StepFileContent data, ImportScheme versionsScheme, ManagedBaseline baseline)
           
private  void doImport(ImportTestHarness.StepFileContent data, ImportScheme versionsScheme, ManagedBaseline baseline, String[] filesFilter)
           
private static void initImportEngine()
          Load the schema and create an import processor.
 void setUp()
          Set-up called before each test is run.
static junit.framework.Test suite()
           
 void testBaselineCreation()
          Tests that (when specified) a baseline is correctly populated with imported parts.
 void testContentFilesSelection()
          Tests that content files are uploaded when present and when requested.
 void testPartDocumentImport()
          Tests that part-to-document relationships are constructed correctly on import.
 void testPartImportSequence()
          Test the ImportScheme logic by importing the same part/version repeatedly and checking that the correct version/part/iteration is created.
 
Methods inherited from class wt.step.processor.ImportTestHarness
assertContentExistence, assertDocMasterExistence, assertDocVersion, assertDocVersion, assertMasteredVersion, assertPartDescribeLink, assertPartMasterExistence, assertPartUsageLink, assertPartVersion, assertPartVersion, erradicateObject
 
Methods inherited from class wt.step.STEPTestCase
assertSTEPTrue, assertSTEPTrue
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, 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

_wtSchema

private static ExpressSchema _wtSchema

_importProcessor

private static ImportFromP21Processor _importProcessor

TEST_PART_MASTER_NUMBER

private static final String TEST_PART_MASTER_NUMBER
See Also:
Constant Field Values

TEST_PART_MASTER_NAME

private static final String TEST_PART_MASTER_NAME
See Also:
Constant Field Values

TEST_SUBPART_MASTER_NUMBER

private static final String TEST_SUBPART_MASTER_NUMBER
See Also:
Constant Field Values

TEST_SUBPART_MASTER_NAME

private static final String TEST_SUBPART_MASTER_NAME
See Also:
Constant Field Values

TEST_DOC_MASTER_NUMBER

private static final String TEST_DOC_MASTER_NUMBER
See Also:
Constant Field Values

TEST_DOC_MASTER_NAME

private static final String TEST_DOC_MASTER_NAME
See Also:
Constant Field Values

TEST_CONTENT_NAME

private static final String TEST_CONTENT_NAME
See Also:
Constant Field Values

TEST_BASELINE_NAME

private static final String TEST_BASELINE_NAME
See Also:
Constant Field Values

TEST_BASELINE_DESCRIPTION

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

ImportTest

public ImportTest(String name)
Method Detail

setUp

public void setUp()
Set-up called before each test is run. This cleans the database of all parts/baselines that are created during the test. This is written here rather than in the 'tearDown' so that created items can also be validated manually using the Windchill GUI.


initImportEngine

private static void initImportEngine()
                              throws Exception
Load the schema and create an import processor. This takes a long time and so its only performed once before all tests.

Throws:
Exception

testPartImportSequence

public void testPartImportSequence()
                            throws Exception
Test the ImportScheme logic by importing the same part/version repeatedly and checking that the correct version/part/iteration is created.

Throws:
Exception

testPartDocumentImport

public void testPartDocumentImport()
                            throws Exception
Tests that part-to-document relationships are constructed correctly on import.

Throws:
Exception

testBaselineCreation

public void testBaselineCreation()
                          throws Exception
Tests that (when specified) a baseline is correctly populated with imported parts. Note: Requires the property 'baseline.folder' to be set to a shared folder that the test baseline can be created in.

Throws:
Exception

testContentFilesSelection

public void testContentFilesSelection()
                               throws Exception
Tests that content files are uploaded when present and when requested.

Throws:
Exception

doImport

private void doImport(ImportTestHarness.StepFileContent data,
                      ImportScheme versionsScheme)
               throws Exception
Throws:
Exception

doImport

private void doImport(ImportTestHarness.StepFileContent data,
                      ImportScheme versionsScheme,
                      ManagedBaseline baseline)
               throws Exception
Throws:
Exception

doImport

private void doImport(ImportTestHarness.StepFileContent data,
                      ImportScheme versionsScheme,
                      ManagedBaseline baseline,
                      String[] filesFilter)
               throws Exception
Throws:
Exception

suite

public static final junit.framework.Test suite()