net.sf.mpxj.junit
Class BasicTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sf.mpxj.junit.MPXJTestCase
              extended by net.sf.mpxj.junit.BasicTest
All Implemented Interfaces:
junit.framework.Test

public class BasicTest
extends MPXJTestCase

This class contains a small set of tests to exercise the MPXJ library.


Field Summary
 
Fields inherited from class net.sf.mpxj.junit.MPXJTestCase
m_basedir, m_ikvm
 
Constructor Summary
BasicTest()
           
 
Method Summary
 void testAutomaticGeneration()
          This test exercises the automatic generation of WBS and outline levels.
 void testBug1()
          Read an MPP file that caused problems.
 void testBug2()
          Read an MPP file that caused problems.
 void testBug3()
          Read an MPP file where the structure was not being correctly set up to reflect the outline level.
 void testBug4()
          Read an MPP8 file with a non-standard task fixed data block size.
 void testCalendars()
          Tests to exercise calendar functionality.
 void testConversion1()
          Exercise the MPP8 import code.
 void testConversion2()
          Exercise the MPP9 import code.
 void testConversion3()
          Exercise the XML import code.
 void testConversion4()
          This method tests two stages of conversion, MPP->MPX->MSPDI.
 void testEmbeddedLineBreaks()
          Write a file with embedded line break (\r and \n) characters in various text fields.
 void testMPP8Flags1()
          Ensure that we are reading MPP8 flags correctly.
 void testMPP8Flags2()
          This test reads flags from an MPP8 file where each set of 20 tasks has a single flag from 1-20 set.
 void testMPP9Aliases()
          Exercise field alias code for MPP9 files.
 void testMPP9Flags1()
          Ensure that we are reading MPP9 flags correctly.
 void testMPP9Flags2()
          This test reads flags from an MPP9 file where each set of 20 tasks has a single flag from 1-20 set.
 void testMSPDIAliases()
          Exercise field alias code for MSPDI files.
 void testMspdiExtendedAttributes()
          This test ensures that the task and resource extended attributes are read and written correctly for MSPDI files.
 void testPasswordProtection()
          Exercise the code which handles password protected files.
 void testPriority()
          Test read and write of priority information.
 void testProjectCalendarExceptions()
          Basic rewrite test to exercise the MPX calendar exception read/write code.
 void testProjectHeader()
          This ensures that values in the project header are read and written as expected.
 void testRelationList()
          Simple test to exercise iterating through the task predecessors.
 void testRemoval()
          Test to exercise task, resource, and assignment removal code.
 void testResourceNotes()
          This method exercises resource notes, ensuring that embedded commas and quotes are handled correctly.
 void testRewrite1()
          This method performs a simple data driven test to read then write the contents of a single MPX file.
 void testRewrite2()
          This method performs a simple data driven test to read then write the contents of a single MPX file.
 void testRewrite3()
          This method performs a simple data driven test to read then write the contents of a single MPX file.
 void testRewrite4()
          Test to ensure that files without tasks or resources generate correct MPX files.
 void testRewrite5()
          Exercise PlannerWriter.
 void testStructure()
          Test to ensure that the basic task hierarchy is represented correctly.
 void testTables()
          Test retrieval of table information.
 void testTaskCalendars()
          Test use of task calendars.
 void testTaskNotes()
          This method exercises task notes, ensuring that embedded commas and quotes are handled correctly.
 void testViews()
          Test retrieval of view information.
 void testWBS()
          Test retrieval of WBS information.
 
Methods inherited from class net.sf.mpxj.junit.MPXJTestCase
assertEquals
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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
 

Constructor Detail

BasicTest

public BasicTest()
Method Detail

testRewrite1

public void testRewrite1()
                  throws Exception
This method performs a simple data driven test to read then write the contents of a single MPX file. Assuming the MPX file contains at least one example of each type of record, this test will be able to exercise a large part of the MPX library.

Throws:
Exception

testRewrite2

public void testRewrite2()
                  throws Exception
This method performs a simple data driven test to read then write the contents of a single MPX file. Assuming the MPX file contains at least one example of each type of record, this test will be able to exercise a large part of the MPX library.

Throws:
Exception

testRewrite3

public void testRewrite3()
                  throws Exception
This method performs a simple data driven test to read then write the contents of a single MPX file. The difference between this test and testRewrite1 is that the sample MPX file uses alternative field separators, decimal separators and thousands separators.

Throws:
Exception

testRewrite4

public void testRewrite4()
                  throws Exception
Test to ensure that files without tasks or resources generate correct MPX files.

Throws:
Exception

testRewrite5

public void testRewrite5()
                  throws Exception
Exercise PlannerWriter.

Throws:
Exception

testAutomaticGeneration

public void testAutomaticGeneration()
                             throws Exception
This test exercises the automatic generation of WBS and outline levels.

Throws:
Exception

testStructure

public void testStructure()
                   throws Exception
Test to ensure that the basic task hierarchy is represented correctly.

Throws:
Exception

testConversion1

public void testConversion1()
                     throws Exception
Exercise the MPP8 import code.

Throws:
Exception

testConversion2

public void testConversion2()
                     throws Exception
Exercise the MPP9 import code.

Throws:
Exception

testConversion3

public void testConversion3()
                     throws Exception
Exercise the XML import code.

Throws:
Exception

testConversion4

public void testConversion4()
                     throws Exception
This method tests two stages of conversion, MPP->MPX->MSPDI. This has been designed to exercise bug 896189, which was exhibited when an MSPDI file was generated from an MPX file which did not have the same set of attributes as a native MPP file.

Throws:
Exception

testRelationList

public void testRelationList()
                      throws Exception
Simple test to exercise iterating through the task predecessors.

Throws:
Exception

testTaskNotes

public void testTaskNotes()
                   throws Exception
This method exercises task notes, ensuring that embedded commas and quotes are handled correctly.

Throws:
Exception

testResourceNotes

public void testResourceNotes()
                       throws Exception
This method exercises resource notes, ensuring that embedded commas and quotes are handled correctly.

Throws:
Exception

testBug1

public void testBug1()
              throws Exception
Read an MPP file that caused problems.

Throws:
Exception

testBug2

public void testBug2()
              throws Exception
Read an MPP file that caused problems.

Throws:
Exception

testBug3

public void testBug3()
              throws Exception
Read an MPP file where the structure was not being correctly set up to reflect the outline level.

Throws:
Exception

testBug4

public void testBug4()
              throws Exception
Read an MPP8 file with a non-standard task fixed data block size.

Throws:
Exception

testMPP8Flags1

public void testMPP8Flags1()
                    throws Exception
Ensure that we are reading MPP8 flags correctly. This test reads a file where the tasks alternately have values of either all true, or all false. Each pair of tasks increases by one in outline level.

Throws:
Exception

testMPP8Flags2

public void testMPP8Flags2()
                    throws Exception
This test reads flags from an MPP8 file where each set of 20 tasks has a single flag from 1-20 set. The next set of 20 tasks increases by one outline level.

Throws:
Exception

testMPP9Flags1

public void testMPP9Flags1()
                    throws Exception
Ensure that we are reading MPP9 flags correctly. This test reads a file where the tasks alternately have values of either all true, or all false. Each pair of tasks increases by one in outline level.

Throws:
Exception

testMPP9Flags2

public void testMPP9Flags2()
                    throws Exception
This test reads flags from an MPP9 file where each set of 20 tasks has a single flag from 1-20 set. The next set of 20 tasks increases by one outline level.

Throws:
Exception

testViews

public void testViews()
               throws Exception
Test retrieval of view information.

Throws:
Exception

testTables

public void testTables()
                throws Exception
Test retrieval of table information.

Throws:
Exception

testTaskCalendars

public void testTaskCalendars()
                       throws Exception
Test use of task calendars.

Throws:
Exception

testMSPDIAliases

public void testMSPDIAliases()
                      throws Exception
Exercise field alias code for MSPDI files.

Throws:
Exception

testMPP9Aliases

public void testMPP9Aliases()
                     throws Exception
Exercise field alias code for MPP9 files.

Throws:
Exception

testEmbeddedLineBreaks

public void testEmbeddedLineBreaks()
                            throws Exception
Write a file with embedded line break (\r and \n) characters in various text fields. Ensure that a valid file is written, and that it can be read successfully.

Throws:
Exception

testPasswordProtection

public void testPasswordProtection()
                            throws Exception
Exercise the code which handles password protected files.

Throws:
Exception

testMspdiExtendedAttributes

public void testMspdiExtendedAttributes()
                                 throws Exception
This test ensures that the task and resource extended attributes are read and written correctly for MSPDI files.

Throws:
Exception

testProjectHeader

public void testProjectHeader()
                       throws Exception
This ensures that values in the project header are read and written as expected.

Throws:
Exception

testWBS

public void testWBS()
             throws Exception
Test retrieval of WBS information.

Throws:
Exception

testPriority

public void testPriority()
                  throws Exception
Test read and write of priority information.

Throws:
Exception

testCalendars

public void testCalendars()
                   throws Exception
Tests to exercise calendar functionality.

Throws:
Exception

testRemoval

public void testRemoval()
                 throws Exception
Test to exercise task, resource, and assignment removal code.

Throws:
Exception

testProjectCalendarExceptions

public void testProjectCalendarExceptions()
                                   throws Exception
Basic rewrite test to exercise the MPX calendar exception read/write code.

Throws:
Exception


Copyright © 2012. All Rights Reserved.