001: package net.firstpartners.nounit.test;
002:
003: /**
004: * Title: NoUnit - Identify Classes that are not being unit Tested
005: *
006: * Copyright (C) 2001 Paul Browne , FirstPartners.net
007: *
008: *
009: * This program is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU General Public License
011: * as published by the Free Software Foundation; either version 2
012: * of the License, or (at your option) any later version.
013: *
014: * This program is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
017: * GNU General Public License for more details.
018: *
019: * You should have received a copy of the GNU General Public License
020: * along with this program; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * @author Paul Browne
024: * @version 0.7
025: */
026:
027: import org.jdom.*;
028: import org.jdom.input.*;
029:
030: import junit.framework.TestCase;
031:
032: import org.gjt.jclasslib.io.*;
033: import org.gjt.jclasslib.structures.*;
034:
035: import java.io.*;
036:
037: /**
038: * Test Information - System Wide Tests
039: */
040: public class TestData extends TestCase {
041:
042: /**
043: * Initialises the Class
044: *
045: */
046: public TestData() {
047: super ("");
048: }
049:
050: /**
051: * Required by JUnit
052: *
053: * @param name name of the test
054: */
055: public TestData(String name) {
056: super (name);
057: }
058:
059: /**
060: * Get a handle to the sample class file , as a File
061: * @return sampleFile
062: */
063: public static File getSampleFile() throws IOException {
064:
065: //Get a handle to the sample file
066: File sampleFile = new File(SAMPLE_CLASS_PROXY);
067: return sampleFile;
068: }
069:
070: /**
071: * Get a handle to the sample class file , but as a ClassFile Structure
072: * @return ClassFileReader
073: */
074: public static ClassFile getSampleClassFile()
075: throws InvalidByteCodeException, IOException {
076:
077: //Get a handle to the sample file
078: File sampleFile = getSampleFile();
079:
080: //Now read and return as byte-code
081: return ClassFileReader.readFromFile(sampleFile);
082: }
083:
084: /**
085: * Get a Simple-XML Document , as pointed to by constants above.
086: * Convience Method for testing
087: * @return sourceDocument - XML Jdom Document
088: */
089: public static Document getSimpleXmlDocument() throws JDOMException,
090: IOException {
091:
092: //Read in the file
093: SAXBuilder builder = new SAXBuilder();
094: Document sourceDocument = builder.build(new File(
095: XML_SIMPLE_OUTPUT));
096:
097: return sourceDocument;
098: }
099:
100: /**
101: * Proxy Class Source - where sample sits
102: */
103: public final static String SAMPLE_CLASS_PROXY = "G:\\NoUnitFiles\\net\\firstpartners\\nounit\\test\\ProxyBean.class";
104:
105: /**
106: * Current Full Root of this project - used to sample entire project
107: */
108: public final static String SAMPLE_CLASS_SOURCE_FULL = "G:\\NoUnitFiles\\";
109:
110: /**
111: * Current (Sample - sub) Class of this project - used in some partial tests
112: */
113: public final static String SAMPLE_CLASS_SOURCE = "G:\\NoUnitFiles\\net\\firstpartners\\nounit\\utility\\";
114:
115: /**
116: * Sample (simple) XML as produced by 1st pass , before any java processing
117: */
118: public static final String XML_SIMPLE_OUTPUT = "G:\\NoUnitFiles\\xml\\project.xml";
119:
120: /**
121: * Sample (with-calls) XML as produced by 2nd pass , after java processing
122: */
123: public static final String XML_CALLS_OUTPUT = "G:\\NoUnitFiles\\xml\\nounit-calls.xml";
124:
125: }
|