Ant, Log4J, Junit, Eclipse

Only available on StudyMode
  • Topic: Apache Ant, Java platform, Java
  • Pages : 4 (666 words )
  • Download(s) : 734
  • Published : May 29, 2010
Open Document
Text Preview
1. Technical Specification

The target application environment Java compiler's version is Java 1.5. Create a project in Eclipse.
Need to connect a database (e.g. Oracle).
Should log error message using Log4J.
Delivery the project as a jar.

2. Procedures

2.1 Create User Library for Log4J and JDBC driver (oracle-jdbc)

2.2 Add these two user libraries to the project build path

2.3 Establish The Application Environment in Eclipse

2.3.1 Create file as a property file for the application to read

2.3.2 Create a file for log4j to read

2.4 Follow the instructions to set up JUnit available to Ant

2.5 Create build.xml file

2.1 Create User Libraries

1. In Eclipse, Window > Preferences > Java > Build Path > User Libraries. 2. Click New button, and enter the 'user library name'.
3. Click Add JARs... button, and select the jar files to be added to this user library. 4. Click OK button.

Do the above steps for Log4J, and oracle-jdbc

2.2 Add User Libraries to the project

1. Right click the project, and select properties (or Alt+Enter). 2. Select Java Build Path > Libraries, and click Add Library... button 3. Select User Library, and click next> button
4. Select lo4j, and oracle-jdbc (the two we just created in the previous step). 5. Click OK to add these user libraries to the project environment.

Doing this can make sure these libraries are in the project classpath.


Add User Library to the project build path will allow the the project to be compile and run using Eclipse internal build and run.

2.3 Establish Project Structure

1. Create build directory, and its sub directories (classes and jar) md build/classes
md build/jar
2. Create lib directory, and copy log4j, oracle-jdbc, and junit jars in.

2.3.1 Create file as a property file for the application to read name1 = value1
name2 = value2

2.3.2 In the src directory, create a...
tracking img