Step 4: Project Setup previous   contents   next
next 

If you are an experienced Together user, you can use the tutorial project snapshots available with the JUnitX and XPTest source distributions (path sample) and skip this part of the tutorial. The project files of Together work independently of the location of the project path. But they reference the JDK, so you might need to edit the project file to reflect the location of your JDK.
You can also paste code from Appendix B so save some work.

For those who have never worked much with Together, here are my recommended steps to set up a new project. Please make sure that you have a suitable JDK and Together version installed (see Appendix A for details).

  1. Create a directory structure
    After creating a project directory, create 'src' and 'diagrams' as subdirectories.

  2. Start the 'New Project Expert'
    Start Together and select the 'New Project Expert...' option in the File menu of Together to create a sample project like this:


    (click on the image for a fullsize screenshot)

    Click on 'Next >' and

  3. Select the source path
    You should enter the 'src' subdirectory of your project path here:


    (click on the image for a fullsize screenshot)

  4. Select diagram path
    In the next dialog, select 'No, I wish to separate them' in order to place UML diagram images in a separate path.

  5. Select diagram path
    In the following dialog, you can enter the 'diagrams' subdirectory of your project path to place the UML diagrams there.

  6. Choose initial diagram type
    In the next dialog, keep the suggested settings: 'Class' is the initial diagram type and the option 'Show package dependencies' is selected.

  7. Import archives (only Together 5.0 and older)
    JUnitX and XPTest are included in Together 5.5 and later versions. For older releases you have to add JUnitX to the list of required archives in the last dialog using the 'Add Zip/Jar' button:


    (click on the image for a fullsize screenshot)

    If JUnitX is not listed in this dialog, Together will create test cases with a missing parent class. Thus they will not be compiled or detected later by XPTest.
    If you are done, click on 'Finish' to create the project.

Now we can create the initial UML diagrams. Because my domain is extreme-java.de, any code will be located in the package de.extremejava. Since not all classes need to be public, the parser-related classes will be placed in a subpackage called url. Create the necessary UML elements using the following steps:

  1. Create the de.extremejava.url package
    Click on the -Button and then on the empty UML diagram area on the right to create a package element. Overtype it's selected name field with 'de' and press Enter to create the first package:


    (click on the image for a fullsize screenshot)

    Double-click on the 'de'-package element to open the new package. After that repeat the above procedure to create the 'de.etremejava' and 'de.extremejava.url' packages.

  2. Create the classes
    Open the 'url' package and click on the -Button and in the empty UML diagram of the 'url'-package to create the first class element. Name it 'URL':


    (click on the image for a fullsize screenshot)

    Create the classes 'Parser', 'URLCharacter' and 'InvalidURLException' the same way in the url package.

The initial UML diagrams are done. The next step is to decide about the visibility of the classes and which methods will be created.

  previous   contents   next
next 

© 2001 A. Heilwagen