1 /*
2 * Copyright (c) 2002-2003 The XDoclet Team.
3 * All rights reserved.
4 */
5
6 package xdoclet;
7
8 import junit.framework.TestCase;
9
10 import java.io.File;
11
12 import xdoclet.util.FileUtils;
13
14 /***
15 * Baseclass for testing of XDoclet.
16 *
17 * @author <a href="mailto:mbo at jcs.be">Mathias Bogaert</a>
18 * @author <a href="mailto:aslak.hellesoy at netcom.no">Aslak Hellesøy</a>
19 * @version $Revision: 1.4 $
20 */
21 abstract public class XDocletTestCase extends TestCase {
22 private XDoclet _xdoclet;
23
24 protected void setUp() throws Exception {
25 super.setUp();
26 // Construct a new XDoclet
27 _xdoclet = new XDoclet();
28
29 // If we're built with Clover, classes are in a different location than usual.
30 // To be safe, just put both locations on the classpath.
31 File cloveredClasses = new File( FileUtils.getRoot(getClass()).getParentFile().getParentFile(),"target/clover/classes" );
32 File regularClasses = new File( FileUtils.getRoot(getClass()).getParentFile().getParentFile(),"target/classes" );
33 _xdoclet.setClasspath(cloveredClasses.getAbsolutePath() + System.getProperty("path.separator") + regularClasses.getAbsolutePath() );
34 }
35
36 public void tearDown() {
37 _xdoclet = null;
38 }
39
40 protected XDoclet getXDoclet() {
41 return _xdoclet;
42 }
43 }
This page was automatically generated by Maven