Software Refactory Elixir Pretty Printer Plugin Elixir Microsoft Visual Source Safe Plugin Elixir Process Tracking Plugin Elixir Printing Plugin Elixir Installation Pretty Printer Line Number Tool Metrics Stub Generator Class file cleaner Jar Generator Code Store Backup JUnit Build Step Download Contributors |  | ## Software::JUnit Build Step |
Elixir's IDE has a powerful capability to add some process into the compilation step. Since in theory, I run the Unit tests for each object immediately after compiling my source code, I don't need this step. The reality is that I am sometimes lazy, and don't run my JUnit tests all the time. This tool allows me to place the JUnit test cases directly into the compilation process. If any unit tests fail, then they are listed in the same way that compiler errors are. With a line number and a file to edit. If you haven't used JUnit before, here is the short description of how to use it. Create an object in the same package as the class you are testing. The JUnit build step requires that the object have a name of "Test" or some other prefix followed by the name of the object that you are testing. The unit test class must extend `junit.framework.TestCase`. Add a constructor that takes a string as input, and passes it off to the parent class. Create the test cases. Each test case is a method whose name starts with the word "Test". Inside each method invoke the method of test case `assert(String message, boolean value);` or `assertEquals(String message, * value1, * value2);`. Add a `protected void setUp()` method to handle any initialization. (If there is any intialization before each test case.) Add a `protected void tearDown()` method to handle any cleanup. (If there is any cleanup after each test case.) To add this as a build step, you need to place the following into your MyProject.project.make file. The step looks like:
    <step code="junit.elixir.JUnitBuildStep">
      <param name="root" value="c:\MySource\"/>
      <param name="prefix" value="Test"/>
    <step>
The root parameter tells which directory contains the top level package. For instance, if I had a class that was in the package org.acm.seguin.refactor. The root parameter specifies the directoring containing org. The prefix parameter tells the build step the name of the unit test object. The object should be Test plus the name of the object being tested.
| Last Modified: October 19, 1999 |